I'm currently having some trouble installing the pygments-package. I tried to run:
pip install pygments
But, however, I get the following Error:
Traceback (most recent call last):
File "/usr/bin/pip", line 11, in <module>
sys.exit(__main__._main())
NameError: name '__main__' is not defined
What's the problem?
Edit: My pip version is 9.0.3
I don't remember exactly what it is, but for me it helped simple sudo pip install pygments or pip3 install pygments
Related
I'm trying to install Odoo 15.0 on mac (python 3.7) when i come to run the command:
pip3 install -r requirements.txt
I got this error message:
Traceback (most recent call last):
File "/usr/local/opt/python#3.7/bin/pip3", line 10, in <module>
from importlib.metadata import distribution
ModuleNotFoundError: No module named 'importlib.metadata'
Try installing this lib manually, using :
pip install importlib-metadata
or
pip3 install importlib-metadata
I installed pip3 using sudo apt-get install python3-pip after that when I run the following command to install django sudo pip3 install django I get this error:
Traceback (most recent call last):
File "/usr/bin/pip3", line 9, in
from pip import main
File "/usr/lib/python3/dist-packages/pip/init.py", line 14, in
from pip.utils import get_installed_distributions, get_prog
File "/usr/lib/python3/dist-packages/pip/utils/init.py", line 23, in
from pip.locations import (
File "/usr/lib/python3/dist-packages/pip/locations.py", line 9, in
from distutils import sysconfig
ImportError: cannot import name 'sysconfig' from 'distutils' (/usr/lib/python3.8/distutils/init.py)
How do I fix this?
I have tried recently manually installing python3.9 version in my Ubuntu from 3.6 version using apt install python3.9. Then pip3 was broken. The issue is because distutils were not build for the 3.9 version.
So in my case I ran apt install python3.9-distutils to resolve my issue.
In your case make sure to modify 3.x version in distutils command.
This helped but then I got another error: ImportError: No module named 'pip._internal'
The following fixed it:
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3 get-pip.py --force-reinstall
I am trying all day to reinstall pip or pip3
I always have the same problem when i try to run it:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/bin/pip", line 6, in <module>
from pkg_resources import load_entry_point
ImportError: cannot import name 'load_entry_point'
I tried to uninstall and reinstall pip with curl and then with easy_install and now it's a big mess.
I am on the last Mac-osx release
I guess i should remove pip and pip3 completely, but how?
>pip
Traceback (most recent call last):
File "/usr/bin/pip", line 6, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 49, in <module>
from pkg_resources.extern import six
File "/usr/lib/python3.6/site-packages/pkg_resources/extern/__init__.py", line 61, in load_module
"distribution.".format(**locals())
ImportError: The 'six' package is required; normally this is bundled with this package so if you get this warning, consult the packager of your distribution.
I did reinstall with pacman -S python as well as pacman -S python-setuptools, pacman -S python-packaging, and pacman -S python-six, nothing helps.
Almost every other python applications follow the same pattern now (such as qutebrowser and buku.
I think it happened right after I installed vmware-vcli manually following the ArchWiki guide on the topic (I know its perl and might be unrelated though).
Downgrading python-setuptools as suggesting in similar posts by installing the earlier version in /var/cache/pacman/pkg did not fix the problem.
I faced exactly the same problem running pip3 install --upgrade pip.
However, pip3.5 install --upgrade pip worked for me. After this upgrade the error message of pip3 disappeared.
I am absolutely new to python and tried to install Theano.
Therefore I ran $ pip install numpy scipy.
Pip seems up to date but I always get the same error:
Collecting scripy
Using cached Scripy-0.9.3.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/lk/v92bv9gs51x55nwp0cspt3xw0000gn/T/pip-build-ZdGtpP/scripy/setup.py", line 96, in <module>
description=get_description(packages[0], PACKAGE_DIR),
File "/private/var/folders/lk/v92bv9gs51x55nwp0cspt3xw0000gn/T/pip-build-ZdGtpP/scripy/setup.py", line 47, in get_description
pkg = __import__(package, level=1)
File "/private/var/folders/lk/v92bv9gs51x55nwp0cspt3xw0000gn/T/pip-build-ZdGtpP/scripy/lib/scripy/__init__.py", line 11, in <module>
from .edit import *
File "/private/var/folders/lk/v92bv9gs51x55nwp0cspt3xw0000gn/T/pip-build-ZdGtpP/scripy/lib/scripy/edit.py", line 18, in <module>
import yamlog
ImportError: No module named yamlog
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/lk/v92bv9gs51x55nwp0cspt3xw0000gn/T/pip-build-ZdGtpP/scripy/
What am I doing wrong?
Thanks a lot!
No, you must have typed:
pip install numpy scripy # <-- should be `scipy`
You can see clearly from the output it is attempting to install scripy not scipy. Whatever this scripy pip package is, it clearly doesn't define its dependencies properly.
You didn't specify distribution and version but if you have python 2.7 I guess this might work.
sudo apt-get install python-numpy python-scipy python-dev python-pip python-nose g++ libopenblas-dev git
sudo pip install Theano