My RHEL7 has Python 2.7. I installed python3.7 and also installed psycopg2. The issue is when I run the python3 script where psycopg2 module is used, I am getting error below:
ModuleNotFoundError: No module named 'psycopg2'
I cant figure out how to install/attach psycopg2 for python 3.
I tried reintalling pyscopg2. No luck!
Related
I made sure python3 and pip3 were installed and installed sqlalchemy, but no dice.
I'm using Python 3.7.2 and Pycharm as an IDE. I'm trying to import the rasterio packages but its gives me an error in Pycharm ModuleNotFoundError: No module named 'rasterio'. Even I have installed it from the cmd with the GDAL as it is mentioned here https://rasterio.readthedocs.io/en/stable/installation.html . Apparently all the packages that I want to work with has the same issue with Pycharm as even i installed them via the cmd it gives me always that error. I tried to install the rasterio package from Pycharm just as I did with Numpy but It gives me a GDAL problem. For The numpy it worked just fine. Thanks.
I've Python 3.6 Installed on my ubuntu. When i try to run my codes via terminal, python doesnt recognize the modules I've installed with pip3. Lets take flask as an example. In the terminal I can do:
python3
import flask
And I dont get any Import error.But when I've a python file in any location which contains:
import flask
And i run it via terminal:
sudo python file_name.py
I get the following error:
ImportError: No module named flask
Why python doesnt recognize the modules?
check if flask is installed properly:
try pip3 freeze or pip3 list from the location where you are trying to run and check if it has flask is in the list.
if it doesn't exists then reinstall and try.
I'm using Python 3.6 v in Ubuntu 18.04LTS. I installed numpy package using pip. When i used Python 3.6 interpreter it throws
ModuleNotFoundError: No module named 'numpy' and for Python2.7
interpreter it didn't throws any error. Any suggestions will be very helpful. I searched in google and github nothing helped me.
Based on the outputs you posted -
your pip and python are pointing to version 2.7
if you try pip install numpy you will install into your python 2.7 env
if you start python interpreter by default you'll be starting python2.7 and you should be able to find numpy package installed.
if you want to do the same in python3.xx use python3 , pip3 or use
virtual environments
I'm pretty new to Python and programming in general. I'm attempting to use the forecastio module in a Python script on my Raspberry Pi. Its running Raspbian Jesse. I've installed the module like so:
sudo pip install python-forecastio
the installation was successful, but whenever I attempt to use the module in my script (import forecastio) none of the module methods work. I get this error:
import forecastio
ImportError: No module named 'forecastio'
I've tried rebooting after the module installation. It seems that Python just isn't recognizing the module. What am I missing?
Per default the command pip refers to the python 2.7 version of pip.
If you want to use the forecastio module in a python 3 script, you have to use pip3 to install it.