I am trying to install packages with PyCharm but each time I try to do so it gives me an error:
The full command output:
Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm Community Edition 2017.3.2\helpers\packaging_tool.py", line 2, in <module>
import traceback
ModuleNotFoundError: No module named 'traceback'
What would be a way to fix this?
Edit: I am trying to install the "Python packaging tools" which results in that error.
Try to reset from the right hand side at the top of the window of the Interpreter and try to install again
Related
I am trying to get gnuradio to work in a virtualenv. I want to keep my system somewhat clean and my project needs Python 3.9, but my system Python is 3.8 (Ubuntu 20.04.4 LTS).
I install it using sudo apt install gnuradio, but then it ends up in the system dist-packages and I can't import it in my virtualenv. The imports work fine when running the system Python.
I have tried to recreate my virtualenv to use system packages:
python3.9 -m venv --system-site-packages venv
This at least made my virtualenv able to find gnuradio, but when I try importing stuff it fails in several different ways.
>>> from gnuradio import uhd
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/gnuradio/uhd/__init__.py", line 21, in _prepare_uhd_python
from . import uhd_python
ImportError: cannot import name 'uhd_python' from partially initialized module 'gnuradio.uhd' (most likely due to a circular import) (/usr/lib/python3/dist-packages/gnuradio/uhd/__init__.py)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3/dist-packages/gnuradio/uhd/__init__.py", line 68, in <module>
_prepare_uhd_python()
File "/usr/lib/python3/dist-packages/gnuradio/uhd/__init__.py", line 26, in _prepare_uhd_python
from . import uhd_python
ImportError: cannot import name 'uhd_python' from partially initialized module 'gnuradio.uhd' (most likely due to a circular import) (/usr/lib/python3/dist-packages/gnuradio/uhd/__init__.py)
>>> import pmt
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pmt/__init__.py", line 34, in <module>
from .pmt_python import *
ModuleNotFoundError: No module named 'pmt.pmt_python'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3/dist-packages/pmt/__init__.py", line 38, in <module>
from .pmt_python import *
ModuleNotFoundError: No module named 'pmt.pmt_python'
I have struggled with this for several days now and found no solution. Is it even possible to run GNU Radio from within a virtualenv?
I have struggled with this for several days now and found no solution.
Your distro's GNU Radio package is built against your distro's python, so you can't use it with a different python.
So, this is expected.
Is it even possible to run GNU Radio from within a virtualenv?
Sure, you'd need to build it from that virtualenv as well, and tell cmake -DCMAKE_INSTALL_PREFIX=/path/to/virtualenv/ to install into it.
We have a pretty nice anaconda packager, so installing GNU Radio into a Python prefix using conda might be the easiest alternative to that.
Alternatively:
Ubuntu 20.04.4 LTS
There's a new Ubuntu LTS version out! If you go for a system upgrade to Ubuntu 22.04 LTS, you get Python 3.10, and a current GNU Radio 3.10.1 "for free".
I've used pip install pymatgen with Python 3.9.1 on Windows 10 to install pymatgen, but I'm getting the following error:
Traceback (most recent call last):
File "D:\code\pymatgen\pymatgen.py", line 1, in <module>
import pymatgen.core as mg
File "D:\code\pymatgen\pymatgen.py", line 1, in <module>
import pymatgen.core as mg
ModuleNotFoundError: No module named 'pymatgen.core'; 'pymatgen' is not a package
I have also tried to install the previous 2 versions but still getting the same error though I can already see it in the pip list
pymatgen 2022.3.22
What am I missing?
Maybe try using conda ? if this doesn't work then there is definitely some dependencies issue
https://pymatgen.org/installation.html
I'm trying to work on python3 and using mac. I have installed pyobjc-core and pyobjc, but the error said Quartz not found. I'm very new to this kind of installing. Is there any solution?
Here is my error from pycharm:
Traceback (most recent call last):
File "/Users/Thyme/PycharmProjects/DinosourBot/venv/lib/python3.6/site-packages/pyautogui/_pyautogui_osx.py", line 5, in <module>
import Quartz
ModuleNotFoundError: No module named 'Quartz'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/Thyme/PycharmProjects/DinosourBot/Bot.py", line 2, in <module>
import pyautogui
File "/Users/Thyme/PycharmProjects/DinosourBot/venv/lib/python3.6/site-packages/pyautogui/__init__.py", line 110, in <module>
from . import _pyautogui_osx as platformModule
File "/Users/Thyme/PycharmProjects/DinosourBot/venv/lib/python3.6/site-packages/pyautogui/_pyautogui_osx.py", line 7, in <module>
assert False, "You must first install pyobjc-core and pyobjc: https://pyautogui.readthedocs.io/en/latest/install.html"
AssertionError: You must first install pyobjc-core and pyobjc: https://pyautogui.readthedocs.io/en/latest/install.html
Process finished with exit code 1
In case anyone stumbles here use:
pip install pyobjc-framework-Quartz
I have solved the problem by
installing pyobjc-framework-Quartz,
it's provided by pycharm
I'd suggest it's best to install all of pyObjC, rather than just specific frameworks. Invariably, if you're working with Quartz, you're going to need various CoreFoundation objects and constants at the very least. To say nothing of AppKit, or other frameworks, depending on what you're doing.
pip install pyobjc (or pip3) should install everything and let you import Quartz. (It works for me on several pythons!)
According to the documentation of rope-vim plugin I install python-rope and python-ropemode mode packages. However when I try to open some file using vim I get following ImportError:
Error detected while processing function LoadRope:
line 4:
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named ropevim
I have found the ropevim module is already in plugin's directory but when I had tried to import it:
python -c "import ropevim"
I get another ImportError:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "ropevim.py", line 10, in <module>
import vim
ImportError: No module named vim
Have I miss any package? Some ideas? Thank you for your help.
Install ropevim using pip install ropevim
ropevim is currently a Python 2 project.
pip2 install --user --update ropevim
I know it might not be the answer you're looking for, but I'm using klen/python-mode plugin with rope included and it's working like a charm.
I'm also using Vim-Plug to manage my plugins and it's as easy as:
Plug 'klen/python-mode', { 'for': ['python'] }
Here is my .vimrc
Hope this helps! :)
I am using win7 to install the PyInstaller.
I have tried the method accroding to (How to install PyInstaller? )but I failed and there is the log,is there anything wrong?
C:\Python27\pyinstaller-2.0\PyInstaller>python Configure.py
Traceback (most recent call last):
File "Configure.py", line 28, in <module>
from PyInstaller import HOMEPATH, PLATFORM
ImportError: No module named PyInstaller
Thanks!
Try going to the system properties and go to the environment variables and set the PATH to the address of where the pyinstaller is located.