I installed anaconda and pycharm. I was working on juypter. I installed numpy but when I am running my program in jupyter then its showing that 'there is a problem in importing numpy libraries, first uninstall it and then install again'. can anyone help me that why this error is and how I can uninstall numpy in anaconda and how again correctly I can install it?? and do I need to install it in a specific drive?
ImportError: Something is wrong with the numpy installation. While importing we detected an older version of numpy in ['C:\ProgramData\Anaconda2\lib\site-packages\numpy']. One method of fixing this is to repeatedly uninstall numpy until none is found, then reinstall this version.
Anaconda comes with Python and 100+ popular packages, including numpy. My guess is that you used pip to install another copy of numpy into your Anaconda installation.
You can check by running:
pip freeze
If you see two copies of numpy, you have a problem. You can try to uninstall it using
pip uninstall numpy
But my guess is that it may break your installation. Your best bet is to uninstall and reinstall Anaconda. (You should also consider upgrading to Anaconda3 with Python 3.).
Going forward, if you are going to use Anaconda, you should use Conda to install packages whenever possible. I.e.
conda install numpy
Related
got a new laptop (MacBook Air with Catalina) and installed python 3 thru Homebrew.
When trying to install and run some libraries in a jupyter notebook (also installed thru Homebrew) like:
!pip3 install pandas
and then:
import pandas as pd
I get the error:
ModuleNotFoundError: No module named 'pandas'
Same thing with numpy, matplotlib, bs4, etc. Even though when I rerun the !pip3 install something I get the message:
Requirement already satisfied: numpy in /usr/local/lib/python3.8/site-packages (1.19.2)
When I run:
!which python3
!which pip3
I get
/usr/local/bin/python3
/usr/local/bin/pip3
is there something I'm doing wrong?
I’ve catch like this problem
It helped me that:
Uninstall python
And install python
Then reboot system
I guess your Catalina use 3 version py3 this time
It’s need realias
I guess on Mac OS is better to use pip3 by terminal.
Problem seemed to be installing jupyter thru homebrew. Uninstalled it, and then reinstalled it with pip and now everything is working
I'm trying to uninstall numpy & then install a specific version of it on anaconda. However, the prompt also told that others packages will also uninstall itself. How do I uninstall only numpy packages? I'm using ubuntu 18.04.
If you anaconda contain pip tool, you can uninstall numpy only through pip uninstall numpy
When I pip install (or pip install --upgrade) packages that require numpy, they have a tendency to uninstall my existing numpy+mkl (which has a high enough version to satisfy the numpy version requirement). Afterwards, they install numpy without +mkl, which causes problems for other packages that do require MKL. An example for which this happens is gym (which has 'numpy>=1.10.4' in its install_requires in setup.py).
I understand that this is related to the +mkl suffix that probably somehow messes with the versions, and understand I can fix it afterwards by downloading and installing numpy+mkl from https://www.lfd.uci.edu/~gohlke/pythonlibs/, but it gets annoying to manually do this every time over again when upgrading a package like gym to a new version. Is there any way to prevent numpy+mkl from getting uninstalled during the pip install --upgrade?
For me, this is happening on Windows 10, Python 3.6. I did not yet check if the same happens on Linux, but would be interested in an answer for that too if it's different there.
My currently installed version of numpy+mkl (which often gets automatically uninstalled) is 1.13.3+mkl.
Using --upgrade-strategy, as suggested by cgohlke in a comment, addresses this problem. So, taking the example where we want to install gym from scratch without it replacing our existing numpy+mkl installation with regular numpy, the full command to run is:
pip install --upgrade-strategy only-if-needed gym
Or, if we just want to upgrade an existing installation, we also add --upgrade
pip install --upgrade --upgrade-strategy only-if-needed gym
I have found that some packages force pip to reinstall numpy. The safest (and only) way to ensure that numpy is installed with mkl (from conda) is to uninstall using conda and pip and then reinstall using conda:
conda uninstall numpy
pip uninstall nump
conda install numpy
I have problems with installing SciPy on windows. I've already tried pip install (which worked for NumPy) but it didn't work out. Any idea how to solve this problem?
I recommend installing Anaconda which is a binary distribution system, which means that you don't need to compile yourself. Overall I find this to be a far easier way to handle packages on windows.
Using Anaconda, you can install scipy via:
conda install scipy
A good way with those kind of packages (scipy, numpy, ...) on Windows is to download (unoficial) binaries from this website and install it from here.
Once download, you can install it using pip :
pip install scipy-package.whl
I want to install NumPy using the pip install numpy command, but I get the following error:
RuntimeError: Broken toolchain: cannot link a simple C program
I'm using Windows 7 32 bit, Python 2.7.9, pip 6.1.1 and some MSVC compiler. I think it uses the compiler from Visual C++ 2010 Express, but actually I'm not sure which one, because I have several Visual Studio installations.
I know that there are prebuilt packages for Windows, but is there some way to do it just by typing pip install numpy?
I think that there could be other packages which must be compiled before usage, so it's not only about NumPy. I want to solve the problem with my compiler, so I could easily install any other similar package without necessity to search for prebuilt packages (and hope that there are some at all).
Check the installation of Python 2.7, and then install/reinstall pip which is described here. Then a open command line windows and write:
pip install numpy
Or
pip install scipy
If already installed, try this:
pip install -U numpy
Installing extension modules can be an issue with pip. This is why Conda exists. Conda is an open-source BSD-licensed cross-platform package manager. It can easily install NumPy.
Two options:
Install Anaconda here
Install Miniconda here and then go to a command line and type conda install numpy (make sure your PATH includes the location Conda was installed to).
Frustratingly, the NumPy package published to PyPI won't install on most Windows computers: Windows wheel package (.whl) on Pypi #5479
Instead:
Download the NumPy wheel for your Python version from Archived: Unofficial Windows Binaries for Python Extension Packages, NumPy
Install it from the command line:
pip install numpy-1.10.2+mkl-cp35-none-win_amd64.whl
As of March 2016, pip install numpy works on Windows without a Fortran compiler. See here.
pip install scipy still tries to use a compiler.
July 2018: mojoken reports pip install scipy working on Windows without a Fortran compiler.
py -m pip install numpy
Worked for me!
Install miniconda (here)
After installed, open Anaconda Prompt (search this in Start Menu)
Write:
pip install numpy
After installed, test:
import numpy as np
First go through page Download Python to download Python 3.6.1 or 2.7.13 either of your choice. I preferred to use Python 2.7 or 3.4.4.
Now after installation, go to the folder name python27 or python34, and click on the script. Now here open the command prompt by left clicking and Run as administrator.
After the command prompt appears, write "pip install numpy" there. This will install the latest version of NumPy and installing it will show a success comment. That's all.
Similarly, Matplotlib can be installed by just typing "pip install matplotlip". And now if you want to download SciPy, then just write "pip install scipy" and if it doesn't work then you need to download Python SciPy from SciPy: Scientific Library for Python and install it.
I had the same problem.
I decided in a very unexpected way. I just opened the command line as an administrator. And then typed:
pip install numpy