Problems installing Python modules

In summary, the person is struggling to get Python 3.5 installed and installed add-on modules such as numpy, scipy, matplotlib, etc. However, when they try to import them into python they get the following error message: "ImportError: No module named 'numpy'" and so on. They also mention that when they try to install VPthyon it tells them they need to install the older version of Python 2.7 first. They are also confused about Anaconda and what it is. Finally, they mention that they are frustrated with the setup and lack of clarity around how to get started.
  • #1
DiracPool
1,243
516
I've installed Python 3.5.1 successfully, and I've downloaded add-on modules such as numpy, scipy, matplotlib, etc, but when I try to import them into python I get the following: "ImportError: No module named 'numpy'", etc.

There's no executable file in the numpy download to activate anything, so I'm stumped as to what to do. This is all very confusing. Plus, when I try to install VPthyon, it tells me I have to install the older version of python 2.7.

Then there's this thing called "Anaconda" I keep running into that seems popular but I don't know how it's different than the regular Python. All I want to do is get Python up and running on my computer with the appropriate math modules so I can start learning how to program. Nothing fancy. Can someone provide some guidance? Thanks
 
Technology news on Phys.org
  • #3
Anaconda is a distro of IPython. Its very good everything installs when you install it. It uses the IPython Notebook web page for developing your code and it can run IJulia for Julia numerical programming.

Here's more on this distro:

http://www.quant-econ.net/py/getting_started.html
 
Last edited by a moderator:
  • #4
jedishrfu said:
Anaconda is a distro of IPython. Its very good everything installs when you install it

Should I just uninstall everything I have so far and install Anaconda? It looks as if you do this, then you can just install the "SciPy stack" on top of this: https://www.scipy.org/install.html
 
  • #5
I don't know. It seems like a good strategy but I've never tried it. However, since you're just starting out I don't think it will break stuff on your machine and Anaconda will install properly so things should work out of the box.

Also I thought anaconda came with the scipy stack too.

https://docs.continuum.io/anaconda/pkg-docs
 
  • Like
Likes DiracPool
  • #6
This has been a very frustrating experience so far. There's too many independent moving parts in this environment and compatibility issues for a beginner like me to navigate. I'm watching tutorials and following instructions and very few things are installing correctly. Plus, the backwards compatibility from Python 3.5 to 2.7 is not good. So running 3.5 and watching a tutorial in 2.7 is pretty much useless for me because the syntax has been changed.

What should I do? Should I use 3.5 or 2.7? It seems that I can't even use VPython at all unless I'm running 2.7.
 
  • #7
Well one idea is to try Processing IDE. It has a python mode where you can experiment with python in a graphical way. (processing.org)

http://py.processing.org/

Did you try the PYTHONPATH setting I mentioned initially?

Personally I use a programmers editor like vi/vim or atom to do my development and then run my code from the commandline.

With anaconda you run your code from a web page and the results appear back in the web page. It's a nice environment and personally I would stick with it as it comes with everything important already installed. You should choose whether you want to develop in Python 2 or 3 mode. I would think you want Python 3 as Python 2 will slowly disappear as 3 takes over but things change so who knows there's been enough resistance to 3 that they've had to backport some features to 2 to keep things moving along.
 
  • Like
Likes DiracPool

Related to Problems installing Python modules

1. Why am I getting an error message when trying to install a Python module?

There could be multiple reasons for this. Some common reasons include incorrect installation of Python, wrong version of the module being installed, or missing dependencies. Make sure to check the installation instructions for the specific module and ensure that your Python environment is set up correctly.

2. How do I install a Python module?

The recommended way to install a Python module is to use a package manager such as pip. Simply open your command line and type "pip install ". This will download and install the module and any necessary dependencies automatically.

3. What should I do if the installation of a Python module fails?

If the installation fails, first check for any error messages or warnings that may indicate the cause of the failure. You can also try installing the module using a different package manager or manually downloading and installing the module from the source code. If all else fails, you can seek help from the community on forums or the module's official website.

4. Is it possible to install multiple versions of the same Python module?

Yes, it is possible to install multiple versions of a Python module on the same system. This can be useful if you need to use different versions of a module for different projects. However, it is recommended to use virtual environments to manage different versions of modules to avoid conflicts.

5. How do I update a Python module to the latest version?

To update a Python module to the latest version, use the command "pip install --upgrade ". This will check for any updates to the module and install the latest version. You can also specify a specific version to update to by specifying the version number after the module name.

Similar threads

  • Programming and Computer Science
Replies
8
Views
892
  • Programming and Computer Science
Replies
8
Views
1K
  • Programming and Computer Science
Replies
1
Views
1K
  • Programming and Computer Science
Replies
16
Views
2K
  • Programming and Computer Science
Replies
2
Views
1K
  • Programming and Computer Science
Replies
1
Views
916
  • Programming and Computer Science
Replies
25
Views
2K
  • Programming and Computer Science
Replies
4
Views
5K
  • Programming and Computer Science
Replies
9
Views
880
  • Programming and Computer Science
Replies
8
Views
1K
Back
Top