Python3 Modules not loading on other computers - python

I have been coding an python application in PyCharm and I have had an issue when trying to run to program on other devices. When cloning the repo on my laptop I keep getting this error:
Traceback (most recent call last):
File "/home/matthew/PycharmProjects/HealthTrackerForRachel/Main.py", line 4, in <module>
from PyQt5 import QtWidgets
ModuleNotFoundError: No module named 'PyQt5'
I have done pip install PyQt5 on my current computer so it should have the module. I am also using venv so could this be causing an issue?

I think the problem has to do with installing PyQts5. here the question was answered already ImportError: No module named PytQt5.

Related

Python No module named 'TikTok Api'

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)

I can`t import wxpython in anywhere except python console

I installed python 3.8.8 and installed wxpython using pip at terminal
pip install wxpython
and i run simple program
import wx
print(wx.version())
in pycharm and pycharm`s python console, I got
ModuleNotFoundError: No module named 'wx'
in IDLE, I got
Traceback (most recent call last):
File "C:/Users/tasoo/OneDrive/Desktop/wx.py", line 1, in <module>
import wx
File "C:/Users/tasoo/OneDrive/Desktop\wx.py", line 2, in <module>
print(wx.version())
AttributeError: partially initialized module 'wx' has no attribute 'version' (most likely due to a circular import)
in python.exe code works
I want to import wx in pycharm project.
I tried add python in system path but it didn`t work.
You have problem because you saved code in file wx.py and now import wx loads your file wx.py instead of module wx. Rename your file - ie. main.py instead of wx.py
PyCharm may have own Python installed and it may need to install wx in this Python.
Check
import sys
print(sys.executable)
to get full path to Python used by PyCharm and then use this path
/full/path/to/python -m pip install wx
Or search in PyCharm settings (in menu File) and change Python Interpreter.
In PyCharm for every project you may set different Python - if you have installed many versions.

How do you fix this error: "ImportError: DLL load failed: The specified module could not be found." using PyQt5

I am currently using Python 3.6.8 and PyQt5. My program was working fine but after a Windows Update, everything stopped working.
Here is the error:
Traceback (most recent call last):
File "main.py", line 10, in <module>
from PyQt5 import QtWidgets, QtCore, QtGui
ImportError: DLL load failed: The specified module could not be found.
I fixed this error by running the following command on my command prompt:
pip install pyqt5-tools
It looks like the environment variables have become corrupt after the update. In the simplest case, it should just be
Adding your DLL location of python, for example,
(C:\Program Files\Python35\DLLs)
in the path in Environment variables. You can also see some others possible solutions here
Change your interpreter you are using in the IDE i.e. use the same version of python which is running in your cmd prompt. This solved my error.

No Module After Install Package via Canopy Package Management

I need help with the pyodbc Python module. I installed it via Canopy package management, but when I try to import it, I get an error (no module named pyodbc). Why?
Here's the output from my Python interpreter:
import pyodbc
Traceback (most recent call last):
File "", line 1, in
import pyodbc
ImportError: No module named 'pyodbc
For the record: the attempted import was in a different Python installation. It is never good, and usually impossible, to use a package which was installed into one Python installation, in another Python installation.

win32 Python - pythoncom error - ImportError: No module named pywintypes

I am trying to import pythoncom, but it gives me this error: Traceback (most recent call last):
File "F:/Documents and Settings/Emery/Desktop/Python 27/Try", line 2, in
import pythoncom
File "F:\Python27\lib\site-packages\pythoncom.py", line 2, in
import pywintypes
ImportError: No module named pywintypes
I reinstalled Python win32, but it still doesn't fix it. Any help? Also, I am trying to access the pythoncom.PumpMessages() method, an alternative would be nice as well.
If you are using an IDE like I am (PyCharm), you should go the where the Python is installed e.g C:\Users\***\AppData\Local\Programs\Python\Python37\Lib\site-packages
In this folder check for the folder name pywin32. Copy that folder and paste it to C:\Users\***\PycharmProjects\project\venv\Lib\site-packages. After that restart your IDE, then it will import the pywin32 as it did in my case. I hope it helps.
pip install --upgrade pywin32==228

Categories

Resources