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!
Related
I'm running python 3.9 and my goal is to install and import pyscopg2:
python --version
Python 3.9.12
conda env list
# conda environments:
#
base * /home/doug/anaconda3
Looks like I'm in anaconda base env.
conda install psycopg2
Collecting package metadata (current_repodata.json): done
Solving environment: done
# All requested packages already installed.
Now, when I try to import:
Enter python terminal:
python
Python 3.9.12 (main, Apr 5 2022, 06:56:58)
[GCC 7.5.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
Then try to import:
import psycopg2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/doug/Documents/Projects/Zen/Projects/data-scripts/ga4ExtractLoad/psycopg2/__init__.py", line 50, in <module>
from psycopg2._psycopg import ( # noqa
ModuleNotFoundError: No module named 'psycopg2._psycopg'
It looks like /home/doug/Documents/Projects/Zen/Projects/data-scripts/ga4ExtractLoad/psycopg2 is masking what is installed into your base environment.
Try running this import from a different directory and/or delete /home/doug/Documents/Projects/Zen/Projects/data-scripts/ga4ExtractLoad/psycopg2.
See ModuleNotFoundError: No module named 'psycopg2._psycopg
I have tried to install matplotlib in my environment "cs323V2"with the following commands:
(cs323V2) conda install matplotlib
Collecting package metadata (current_repodata.json): done
Solving environment: done
# All requested packages already installed.
Retrieving notices: ...working... done
(cs323V2) python
Python 2.7.5 (default, Nov 16 2020, 22:23:17)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
[3]+ Stopped python
>>> import matplotlib
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'matplotlib'
Use the conda-forge channel.
conda install -c conda-forge matplotlib
I am not really sure why only
conda install matplotlib
does not work.
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'
wonder if anyone has tried IntelPython with anaconda. i created an environment as in url link
Intel Python
however, when i try to import pytables, i get: -
(intelpython) dc#dcpctw:/opt/anaconda3/bin$ python
Python 3.5.3 |Intel Corporation| (default, Apr 27 2017, 18:08:47)
[GCC 4.8.2 20140120 (Red Hat 4.8.2-15)] on linux
Type "help", "copyright", "credits" or "license" for more information.
Intel(R) Distribution for Python is brought to you by Intel Corporation.
Please check out: https://software.intel.com/en-us/python-distribution
>>> import tables
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'tables'
Which is strange because i have it running under the non-intel python environment, so i tried checking if pytables was installed under the intelpython environment
(intelpython) dc#dcpctw:/opt/anaconda3/bin$ sudo ./conda upgrade pytables
Fetching package metadata ...........
Solving package specifications: .
# All requested packages already installed.
# packages in environment at /opt/anaconda3:
#
pytables 3.3.0 np112py35_intel_2 [intel] intel
(intelpython) dc#dcpctw:/opt/anaconda3/bin$
So its installed in the environment and should work, any help? thanks
You are running the python executable from /opt/anaconda/bin but you have an activated environment of (intelpython). Change to a different directory, e.g., ~, make sure the first python on your PATH is /opt/anaconda3/envs/intelpython/bin/python, and try the import again.
After installing the TensorFlow CPU version with virtualenv (in Ubuntu 14.0), when I try to test the installation with Python (not from the source directory), I get the following error:
No module named tensorflow
Any explanation?
I am following the exact sequence of steps from the TensorFlow installation page.
Python 2.7.12 (default, Nov 19 2016, 06:48:10)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named tensorflow
>>>
Tensoflow works only with Python 3.5.x version
Tensorflow does work with python 2.7 https://www.tensorflow.org/install/pip. Just wanted to add it here so no one get it wrong. Cant comment since I don't have the reputation yet :(
Check your env and pip to make sure you have installed it for the correct python version in the env.