Im trying to figure out where the problem is.
When I run the code, I got an error "Traceback (most recent call last):
File "C:\Users\user\IdeaProjects\tiktokAnalyse.idea\main\main.py", line 2, in
import TikTokApi
ModuleNotFoundError: No module named 'TikTokApi' "
Ive installed "pip install TiKTokApi" and imported with
"from TikTokApi import TikTokApi"
Cant figure out where the problem is...
make sure you pip installed it, if the issue is still there, restart the editor. also, check if you have activated the environment in which you pip installed the module(if you are using anaconda)
Related
I'm trying to run a code with my command prompt, it initially gives me some requirement of the modules and i installed all of those successfully. but when try to run the code with python main.py the 1st module need to be import for the code colorama, it appears, no module named colorama. the complete code is given below, I need help guys', as soon as possible, please.
My OS is window 10 and I'm using python310
the code is:
`
PS C:\Users\hp\Desktop\NFT1\Codes\NFTs_Upload_To_OpenSea_With_Metadata-main> python main.py
Traceback (most recent call last):
File "C:\Users\hp\Desktop\NFT1\Codes\NFTs_Upload_To_OpenSea_With_Metadata-main\main.py", line 2, in <module>
from colorama import init, Fore, Style
ModuleNotFoundError: No module named 'colorama'
PS C:\Users\hp\Desktop\NFT1\Codes\NFTs_Upload_To_OpenSea_With_Metadata-main> python3 main.py
Traceback (most recent call last):
File "C:\Users\hp\Desktop\NFT1\Codes\NFTs_Upload_To_OpenSea_With_Metadata-main\main.py", line 2, in <module>
from colorama import init, Fore, Style
ModuleNotFoundError: No module named 'colorama'
PS C:\Users\hp\Desktop\NFT1\Codes\NFTs_Upload_To_OpenSea_With_Metadata-main> pip install colorama
Requirement already satisfied: colorama in c:\users\hp\appdata\local\programs\python\python310\lib\site-packages (0.4.6)
`
you can see above, when i ran the code, the error appears, then i check the colorama, and it is already installed. Plus I've already tried by uninstalling it first and then installing it again, still not worked for me.
Thanks
I have uninstalled the module and then re installed it again, not worked
I have upgraded the pip, sill not worked
these are more modules, need to be imported after colorama, and I'm afraid that the same problem may come again with those modules too
When I try to use installed packages in Python, I nearly always run into the same error.
So I e.g. install a package like this: pip3 install mathplot and when I afterwards want to use it in Python3 (I use python3 in the command prompt), I run into the ModuleNotFoundError:
>>> import mathplot
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'mathplot'
But when I run just python, the module is found and ready to use.
Any idea where this problem comes from and how I can get rid of it?
Thanks in advance
import pyinputplus as pyip
while True:
prompt='Want to know how to keep an idiot busy for hours?\n'
response=pyip.inputYesNo(prompt)
if response=='no':
break
print('Thank you. Have a nice day.')
When I run my above code , I get this error:
Traceback (most recent call last):
File "c:\users\XXXXXX\mu_code\idiot.py", line 1, in <module>
import pyinputplus as pyip
File "c:\users\XXXXXX\mu_code\pyinputplus\__init__.py", line 15, in <module>
import pysimplevalidate as pysv # type: ignore
ModuleNotFoundError: No module named 'pysimplevalidate'
I cannot figure it out. The module is definitely installed. I've even moved it from the folder it was originally installed in to the mu folder where the py file is saved. Any help would be appreciated.
The ModuleError says that you do not have pysimplevalidate installed.
Using the same python executable as you are using to run your script (idiot.py), run
python -m pip install pysimplevalidate
or, even more bullet-proof:
<path_to_python.exe> -m pip install pysimplevalidate
If you are not sure what python executable the script is using, you can check it with
# put this on top of your script
import sys
print(sys.executable) # will print C:\path\to\python.exe
I have an issue with the gspread module, and I think with Python 3 too.
My code is something like that: import blabla, gspread, etc...
And if I try to run it python3 myscript.py every module seems to run fine, except gspread. I receive this error:
Traceback (most recent call last):
File "z_schedule.py", line 3, in <module>
from z_database import *
File "/home/pi/Projects/InstaPy/z_database.py", line 3, in <module>
import gspread, gspread_formatting
ModuleNotFoundError: No module named 'gspread'
I'm running python3 and I installed gspread both with pip and pip3. I also installed oauth2 in the same way.
My code used to work great until I updated my Raspberry, InstaPy and Python 3. Somebody knows how to fix it? Thanks.
Try this:
pip3 install gspread
and run the script again. I hope it helps to solve the problem
i'm currently into learning a bit of python and i want to import the paperclip third party module into my python file.
Yes, i already installed the pyperclip module with
pip install pyperclip.
if i create a file on my desktop, i get an error which says
Traceback (most recent call last):
File "test.py", line 1, in <module>
import pyperclip
ImportError: No module named pyperclip
However if i put the test.py in my python folder, it runs.
The question now is, is there a way to make all my installed modules available on a global scope ? I just want to have my file e.g. on my Desktop and run it without having import issues.
Thank you.
Greetings
Edit: I'm working on a Mac, maybe this leads to the problem
Found the problem.
The pip installautomatically used pip3.5 install
whereas python test.pydidn't use python3.5 test.py
Thank you #Bakurìu
Is there a way i can define python3.5as python?
You can do this :
pip3.5 install paperclip
pyperclip is install but not paperclip