添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
无邪的黄花菜  ·  在 pandas ...·  1 年前    · 
还单身的白开水  ·  python - Creating ...·  1 年前    · 
路过的帽子  ·  javascript - Expo ...·  1 年前    · 
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

already changed interpreter to python3 it is working on bash terminal both python 2.7 and python3

import datetime as dt
import numpy
import matplotlib as plt
from matpololib import style
import pandas as pd
import pandas_datareader.data as web
style.use('ggplot')
                You should install numpy in the environment which is used for your project. Try opening terminal in PyCharm and run pip install numpy.
– Mikhail Berlinkov
                Jan 4, 2019 at 18:02
                tks I tried, answer You are using pip version 10.0.1, however version 18.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command.
– Diogo Stringari
                Jan 4, 2019 at 18:06
                tks, working on terminal inside PyCharm it works ok. But how can I fix the error coding and run with the coding environment?
– Diogo Stringari
                Jan 4, 2019 at 18:12
                You should check in setiings->Project->Project interpreter the environment used for the project. You'll see installed packages there as well.
– Mikhail Berlinkov
                Jan 4, 2019 at 18:17

assume that you're using macOS with pyenv for different python versions.

Take the matplotlib stacked bar graph bar_stacked.py as the example (you could get the .py from https://matplotlib.org/gallery/lines_bars_and_markers/bar_stacked.html#sphx-glr-gallery-lines-bars-and-markers-bar-stacked-py).

short answer: quickly configure pyenv python as this snapshot shows:

quick config steps

details

  • open the bar_stacked.py with PyCharm;

  • check your python environment settings:

  • 2.1 check your python version with your terminal:
  • ABC-MacBook-Pro:~ ABC$ which python /Users/ABC/.pyenv/shims/python

  • 2.2 check your pyenv installed pythons
  • ABC-MacBook-Pro:~ ABC$ pyenv versions system * 3.7.0 (set by /Users/ABC/.python-version)

  • 2.3 confirm the python version you're using, here is Python 3.7.0
  • ABC-MacBook-Pro:~ ABC$ python --version Python 3.7.0

    3.configure the PyCharm interpreter as follows:

  • 3.1 PyCharm -> Preferences -> Project -> Project Interpreter, you'll see a icon like a gear, click it and choose Add...

  • 3.2 choose Virtualenv Environment on the left

  • 3.3 choose Existing environment on the right, in the pop-up, locate the python i'm using as checked in step 2.1, here is /Users/ABC/.pyenv/shims/python

  • 3.4 you can also check the box Make available to all projects if you want

  • finally, this example in PyCharm runs like this:

    running

    Thanks for contributing an answer to Stack Overflow!

    • Please be sure to answer the question. Provide details and share your research!

    But avoid

    • Asking for help, clarification, or responding to other answers.
    • Making statements based on opinion; back them up with references or personal experience.

    To learn more, see our tips on writing great answers.