0

On my working PC (Windows7, no internet connection) there are two Pythons: one is the main (C:\Python36-32) with IDLE. Another - freshly installed Anaconda (C:\ProgramData\Anaconda3) - just for scipy and matplotlib (IT guy thought it is the best option).

So, matplotlib works only if I run my scripts from cmd. But it is not comfortable. I prefer IDLE or any other modern environment.

But if I try use matplotlib in IDLE - I got an "No module named 'matplotlib'". I tried to edit sys.path and run:

sys.path.append("C:\\ProgramData\\Anaconda3\\Lib\\site-packages").

It helps a little bit - I got new error "No module named 'matplotlib._path'". So, it looks like IDLE knows what is matplotlib now, but doesn't know it's functions. Is there any way to connect IDLE with Anaconda's libraries? Maybe to append paths recursively?

1
  • The code you write, and in particular, any import statement, is executed by Python, not IDLE. When you run C:\Python36-32\python.exe -m idlelib and enter import xyz in IDLE's Shell, the result should be the same as if you ran C:Python36-32\python.exe and enter the same import xyz in the standard shell. The result you report is slightly puzzling, but I cannot say much without a full traceback and knowledge of the layout of a matplotlib install. Commented Nov 17, 2017 at 20:45

1 Answer 1

1

It's probably not a good idea to mix the python distributions through the system path.

Python should ship with IDLE. So you can use the IDLE from the Anaconda distribution,

C:\ProgramData\Anaconda3>python.exe Lib\idlelib\idle.py

Also note that Anaconda should also provide Spyder. This might be a nicer IDE.

Sign up to request clarification or add additional context in comments.

1 Comment

`...> python.exe -m idlelib will start IDLE as well. As implied, the important part is which python binary is invoked.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.