I'm trying to import pydriller using python interpreter in venv, after installing pydriller with pip I try the following:
from pydriller import RepositoryMining
but the IDE can't recognize "RepositoryMining" and I'm getting this error:
cannot import name 'RepositoryMining' from partially initialized module 'pydriller' (most likely due to a circular import)
Although I can see in the "venv" the "pydriller" folder which contains a file with the class "RepositoryMining",
And after that said, I tried to install pydriller on the system (without venv) and it worked, but the problem is that I need it to be working in the project with the virtual environment, any suggestions on how to fix it?
The problem was that my python file name was "pydriller.py", I needed to rename it to avoid import conflicts (hoping that this will help someone).
Related
resolved
I have set up a conda environment with anaconda, with python 3.9 and paho-mqtt 1.6.1. I have also tested an Environment that worked for someone else but it doesn't work on my System. Other packages work, like numpy.
The code fails at the first row
import paho.mqtt.client as mqtt wit the error ModuleNotFoundError: No module named 'paho.mqtt'; 'paho' is not a package.
Does anyone have a solution or at least some ideas i could try?
For example if i create a new conda env with conda env --create env python=3.9, and then try to run import numpy it obviously doenst run. Then i do pip install numpy and run it again and it works. Though if i do the same with import paho.mqtt it doesn't work even after pip install paho-mqtt.
This error:
ModuleNotFoundError: No module named 'paho.mqtt'; 'paho' is not a package
may also occur if you have named the main program file you created as paho.py and try to run it as python paho.py or another file has the name paho.py in the same folder from which you run your program. Python will consider your program file as a module and try to find something in it that is naturally not in it. About where Python is looking for modules, see sys.path (citate: "...if path[0] is the empty string, which directs Python to search modules in the current directory first...").
In this case, rename your program file so that its name does not equal with the name of the imported module.
Hi i'm recently working on a module in python (package named pykiwoom)
I installed a module in conda 32-bit environment pip install pykiwoom and tried to import this
from pykiwoom.kiwoom import Kiwoom
This works perfectly fine when I execute this in python console in pycharm
However, when I try this in terminal error occurs
ModuleNotFoundError: No module named 'pykiwoom.kiwoom'; 'pykiwoom' is not a package
internal structure of package pykiwoom looks like this
pykiwoom
init.py
kiwoom.py
parser.py
Can somebody tell me why this error occurs?
I think where you install your package is important in your case. You can check the packages installed using pip list in terminal, and check if you find it there.
This solution provides overview of how to setup your files as packages and modules.
Nevertheless, I think if you install your package in the terminal using pip, you could possibly access it.
I am trying to run python file on my terminal and I get the error of "no module named pyside2"
I tried the to run the code which was already answered on similar type of question. But no changes on my side.
ERROR message:
Traceback (most recent call last)
File "xxx-qt.py", line 31, in <module>
from pyside2 import qtcore
Modulenotfounderror: NO module named "pyside2"
The problem arises because you haven't the module in your environment, you can install it using pip install PySide2
For more about PySide2: https://pypi.org/project/PySide2/
You used all lower-case letters in your PySide2 import statement.
The error message shows that your code imports using lowercase letters instead of mixed case:
NO module named "pyside2"
You probably installed PySide2 using all lowercase letters, pip install pyside2, but your code must import from: PySide2.
I solved this issue by:
1. Repairing my Python installation
2. Deleting the virtual environment
3. Creating a new virtual environment
4. Running pip install PySide2 in the new virtual environment
I had the same problem and solved it with the following way.
Reference from Qt for Python & PyInstaller
Since it has a UI, you use the –windowed option.
The command line to proceed looks like this:
pyinstaller --name="MyApplication" --windowed hello.py
This process creates two directories: dist/ and build/. The
application executable and the required shared libraries are placed in
dist/MyApplication.
To run the application, go to dist/MyApplication and run the program:
cd dist/MyApplication/
./MyApplication
Well there might be one of these two problems:
You have not installed PySide2, In that case you can install it using command pip install PySide2
The second is you have installed the Pyside2 but in one installation and trying to use it from another installation, to tackle with this, Create a virtual environment for your project and install all modules in that virtual environment.
It's always a good idea to create virtual environment for project it will avoid breaking the base env. It avoid such kind of issues
I have recently installed python 2.17.14 to use a package which I installed in the command prompt with:
python -m pip install packageName
However, whenever I try to use it with a script provided by the package authors, I get Import Errors:
ImportError: cannot import X from YX
ImportError: attempted relative import with no known parent package.
I don't know what I'm doing wrong, as I am really new to Python. Does anyone have any ideas?
The package is called neurodesign and I downloaded the try out script from the official website "neuropowertools.org"
Best,
Max
In case anyone (who is also new to python^^) fails ridiculously at this task as well: I had to manually install all the modules used within this package for it to work as they weren't installed automatically.
I am facing a strange error. I have installed pyrenn module with pip install in conda environment and solved an ANN problem successfully. But when I restarted the kernel in jupyter or spyder, I am not able to even import the module which shows error: module 'pyrenn' has no attribute 'CreateNN'. But it definitely has the module and it worked last time.
what may be the possible problem?
If you look at your screenshot it shows a path ~/ANN study/pyrenn/pyrenn.py. So not only you are creating a conflicting folder name pyrenn you are also creating a conflicting importable file pyrenn.py.
Follow the thumb rule of not naming the folders and your files which conflict with modules that you will uses or are existing.