Unable to import praw - python

I tried pip installing: It worked but nothing else happened.
Requirement already satisfied: praw in c:\users\william\appdata\local\programs\python\python38\lib\site-packages (7.2.0)
Note: Im using visual studio code. But this still happens while using different IDEs, and python itself.
Here is my error:
Traceback (most recent call last):
File "c:\Users\William\Downloads\Rocket\main.py", line 7, in <module>
import praw
ModuleNotFoundError: No module named 'praw'```
Thanks.

Did you use pip install praw command to install it?

Related

Importing a module throws ModuleNotFoundError even after module is installed

I'm trying to install pyperclip on Python 3.8.6 on Windows 10, and after typing
pip3 install pyperclip
in cmd it tells me that pyperclip has been successfully installed, but when I then try import pyperclip on they Python shell I get the following error message:
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import pyperclip
ModuleNotFoundError: No module named 'pyperclip'
I've tried uninstalling and reinstalling pyperclip using pip, and also installing an older version of the package (1.8.0) but the error persists.
Thanks for your help!

Python docx module ModuleNotFoundError

I am a windows 7 user with MS-Office 2016 and python 3.6.
I recently found out that you can write word documents with python.
I looked on how to do that
I installed the docx module:
pip install docx
But whenever i try to import the docx module i get this error:
>>> from docx import Document
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\Huzefa\AppData\Local\Programs\Py
in <module>
from exceptions import PendingDeprecationWarn
ModuleNotFoundError: No module named 'exceptions'
I have even tried this but it wont work:
pip install exceptions
I get this error:
ERROR: Could not find a version that satisfies the requirement exceptions (from versions: none)
ERROR: No matching distribution found for exceptions
I thought that maybe this is happening because docx is a python-2 module but it is not. I found it out here
so can someone tell me what i am doing wrong?
I suggest that you can try like this -
$ pip install --pre python-docx
Or you can also try sudo command -
$ sudo pip install --pre python-docx
After that try -
from docx import Document
From here you can find [https://python-docx.readthedocs.io/en/latest/user/install.html][1]
try using:
pip install python-docx
It worked for me!
The problem here is that the name for installation and usage are different:
To install: pip install python-docx
To use: from docx import Document
Install with the correct name (i.e. python-docx) and it shall work.

Don't understand this ImportError while running my script

I'm running this code from github:
Everything works fine but in 3rd Step when I run:
cd file-on-blockchain/example
and in this when i execute this=> python deploy_contract_and_test.py, It says
Traceback (most recent call last):
File "deploy_contract_and_test.py", line 2, in <module>
from web3 import Web3, HTTPProvider
ImportError: No module named web3
I have seen many people's answers regarding updating pip and all, but nothings working.
Looks like you don't have the web3 module installed. You can install it using pip:
$ pip install web3
there's more detailed information about how to install the package at the official github :
https://github.com/ethereum/web3.py

couldnt install python-colorama

I am trying to install Jarvis ai from https://github.com/sukeesh/Jarvis (I know it is not meant to be installed on windows 10. but I try it anyway)
It said no module named colorama, so I typed pip install python-colorama. Then it said
Could not find a version that satisfies the requirement python-colorama (from versions: )
No matching disribution found for python-colorama
I tried to install it using ubuntu, but different problem occurs: it said
Specify python version(2/3)(Default-3)3
Selected python version 3
Running virtualenv with interpreter /usr/bin/python3
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 22, in <module>
import distutils.spawn
ModuleNotFoundError: No module named 'distutils.spawn'
So its like asking 2 question in one. On windows it is
C:\Users\badarsyah\Jarvis>pip install python-colorama
Collecting python-colorama
Could not find a version that satisfies the requirement python-colorama (from versions: )
No matching distribution found for python-colorama
But on ubuntu 18.04
aiki#LAPTOP-886AEJJG:~/Jarvis$ ./setup.sh
Specify python version(2/3)(Default-3)3
Selected python version 3
Running virtualenv with interpreter /usr/bin/python3
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 22, in <module>
import distutils.spawn
ModuleNotFoundError: No module named 'distutils.spawn'
I hope anyone can help, but please read the GitHub first so you can understand what im trying to do.
I managed to solve this problem by simply update pip with
python -m pip install -U pip
then ran again the install command.

Import error in pyPDF2 when it is correctly installed

I am using python 2.7.6 on Ubuntu 14.04 LTS. When I run this command:
sudo pip install pypdf2
The following message shows up:
Requirement already satisfied (use --upgrade to upgrade):
pypdf2 in /usr/local/lib/python2.7/dist-packages
Cleaning up...
This means that pypdf2 is already installed on my system but when I try to import pyPDF2, this message comes up:
>>> import pyPDF2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named pyPDF2
Capitalization counts. Try import PyPDF2 and see if that works.

Categories