I'm trying to install the python module netcdf4. I seem to have been able to do this successfully, but then I get the "module not found error" when I try to import it in python. Having looked at some similar questions, I suspect the issue has something to do with the path, but I don't know what do about that. Here's what happens specifically:
(base) C:\Users\jwmil>conda install netcdf4
Collecting package metadata (current_repodata.json): done
Solving environment: done
# All requested packages already installed.
(base) C:\Users\jwmil>python
Python 3.7.4 (default, Aug 9 2019, 18:34:13) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import netcdf4 as pc
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'netcdf4'
Related
I am trying to build a wheel file file out of a complete python project. I had followed the steps available online to build wheel file. The wheel is built successfully, it gets installed also but when I try to import in the same environment I get a ModuleNotFoundError
I had followed the steps available online to build wheel file.
(sancus) C:\Users\XXXX\Downloads\sancus-master\sancus-master\sancus\dist>pip install sancus_extraction-0.0.1-py3-none-any.whl
Processing c:\users\XXXX\downloads\sancus-master\sancus-master\sancus\dist\sancus_extraction-0.0.1-py3-none-any.whl
Installing collected packages: sancus-extraction
Successfully installed sancus-extraction-0.0.1
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
(sancus) C:\Users\XXXX\Downloads\sancus-master\sancus-master\sancus\dist>python
Python 3.9.13 (main, Aug 25 2022, 23:51:50) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Warning:
This Python interpreter is in a conda environment, but the environment has
not been activated. Libraries may fail to load. To activate this environment
please see https://conda.io/activation
Type "help", "copyright", "credits" or "license" for more information.
>>> import sancus_extraction
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'sancus_extraction'
>>>
Following instructions from numpy.org I have installed numpy
conda install numpy
The installation was successful, as when I type the above command again, I see the message
Collecting package metadata (current_repodata.json): done
Solving environment: done
# All requested packages already installed.
However, when I start python with python and type import numpy I see an error message
Python 3.8.6 (default, Sep 25 2020, 09:36:53)
[GCC 10.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'numpy'
How can I get access to numpy?
I am using Ubuntu 20.10 and my conda 4.9.2 is installed in
~/.local/opt/anaconda3/ if this can help.
Thanks!
C:\Users\*****>pip install colorama
Collecting colorama
Using cached colorama-0.4.3-py2.py3-none-any.whl (15 kB)
Installing collected packages: colorama
Successfully installed colorama-0.4.3
C:\Users\*****>python
Python 3.8.1 (tags/v3.8.1:1b293b6, Dec 18 2019, 23:11:46) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import colorama
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'colorama'
>>> exit()
C:\Users\*****>pip uninstall colorama
Found existing installation: colorama 0.4.3
Uninstalling colorama-0.4.3:
Would remove:
c:\users\rober\appdata\local\programs\python\python38-32\lib\site-packages\colorama-0.4.3.dist-info\*
c:\users\rober\appdata\local\programs\python\python38-32\lib\site-packages\colorama\*
Proceed (y/n)? y
Successfully uninstalled colorama-0.4.3
C:\Users\*****>pip install "C:\Users\rober\Downloads\colorama-0.4.3-py2.py3-none-any.whl"
Processing c:\users\rober\downloads\colorama-0.4.3-py2.py3-none-any.whl
Installing collected packages: colorama
Successfully installed colorama-0.4.3
C:\Users\*****>python
Python 3.8.1 (tags/v3.8.1:1b293b6, Dec 18 2019, 23:11:46) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import colorama
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'colorama'
I don't know what to do. You can see where I've downloaded the file, I'm running the latest pip version and python 3.8. After searching the internet I've come back empty handed.
I don't know if you still need help for this but I had the same problem and managed to solve it.
I just went into cmd and put:
pip install colorama --user
and it worked for me (new to coding and python so I've got 3.8.3 and have had similar issues with several pip installs).
From the traces
launching python runs the 64 bit of python
C:\Users\*****>python
Python 3.8.1 (tags/v3.8.1:1b293b6, Dec 18 2019, 23:11:46) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
now when you uninstall:
C:\Users\*****>pip uninstall colorama
Found existing installation: colorama 0.4.3
Uninstalling colorama-0.4.3:
Would remove:
c:\users\rober\appdata\local\programs\python\python38-32\lib\site-packages\colorama-0.4.3.dist-info\*
c:\users\rober\appdata\local\programs\python\python38-32\lib\site-packages\colorama\*
Proceed (y/n)? y
Successfully uninstalled colorama-0.4.3
it uninstalls unto the 32 bit version (note the -32 suffix).
So pip probably points to the 32 bit version.
What would work would be using the python command and the -m option to make sure that the proper install is used to install modules:
python -m pip install colorama
You can use where pip and where python, that will confirm that those point to different python packages.
If you don't use it, I suggest that you uninstall the 32-bit version of python to avoid further mixups.
I install new version of Anaconda (Python 3.6) and now I can not import PyQt.
I reinstalled it three times and add <>\Anaconda3.6\Lib\site-packages\PyQt5\Qt\bin to PATH variable. But it did not help.
$ python
Python 3.6.0 |Anaconda 4.3.1 (64-bit)| (default, Dec 23 2016, 11:57:41) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import PyQt5.QtCore
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: DLL load failed: Could not find the specified module
Try to add file python3.dll from python.org to your anaconda's directory.
In my case i had there only python36.dll
Python 3.5.3 (v3.5.3:1880cb95a742, Jan 16 2017, 15:51:26) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> import cv2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: DLL load failed: %1 is not a valid Win32 application.
I am trying to install open cv on python but this message shows up.
should I download opencv of 32 bit is this the case?
The problem is with incompatible lib.numpy is (mostly) compatible with 32bit.
So install
Python (32bit)
Numpy
OpenCV(32 bit)
Python 2.7 is only compatible with OpenCV2
Doesn't matter if you have a 64bit machine, 32-bit software can be run on a 64-bit Operating System.
I used pip install opencv-python it worked for me https://pypi.python.org/pypi/opencv-python