1

I have Python 3.6 installed with Matplotlib and I created a small program, which runs and plots the graph fine. Now, I want to export the data from this program into a MySQL database. I downloaded MySQL/Python connector, which only supports Python 3.4. So, I installed Python 3.4 as well. Now,I have two Python installed. My program runs fine if I do

python test.py

If I go into 3.4 installation directory and run the same command, it fails with the error 'No module named matplotlib'. If I do

pip install matplotlib

from 3.4 directory, then it says 'requirements already satisfied'. Any idea what am I missing here?

0

2 Answers 2

5

Calling pip like this, it's not about the current directory, but just about your system paths. If you want to be sure, you can always go to python-env/Scripts/pip (your python-binary would be at python-env/python).

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

Comments

0

You need to keep your installs separate. The path statement is getting messed up. I would suggest getting anaconda. Once you install it you can get all the packages and dependencies in one action.

conda create -n py34project python=3.4 matplotlib ipython other_package

then easily get python 3.6

conda create -n py36project python=3.6 matplotlib ipython other_package

you can use: source activate py36project to enter the environment (which will fix the path problem) and leave the environment with source deactivate

Comments

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.