I am trying to run Scrapy and encountering the following error.
It seems that Scrapy can't find TheTwisted 10.0.0 - I've downloaded it but don't know where to place the folder. Thanks!
Traceback (most recent call last):
File "/usr/local/bin/scrapy", line 5, in
from pkg_resources import load_entry_point
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/init.py", line 3095, in
#_call_aside
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/init.py", line 3081, in _call_aside
f(*args, **kwargs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/init.py", line 3108, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/init.py", line 658, in _build_master
ws.require(requires)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/init.py", line 959, in require
needed = self.resolve(parse_requirements(requirements))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/init.py", line 846, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'Twisted>=10.0.0' distribution was not found and is required by Scrapy
If using Linux, install Twisted by running pip install Twisted in terminal.
If Windows, the Twisted docs recommend pip install Twisted[windows_platform].
In both cases if you're using a virtual environment (recommended) make sure to install it inside the venv.
Related
This question already has answers here:
The 'pip==7.1.0' distribution was not found and is required by the application
(11 answers)
Closed 1 year ago.
I am having some issues running pip on my iTerm on my Mac (Big Sur 11.4)
I have already tried a couple things.
a. removed the Python framework from /Library/Frameworks (in an effort to clean remove python 3)
b. removed the Python apps from Applications
(that said, python3 still runs the interpreter)
Here is the error message, below.
Any input would be appreciated
Thank you
File "/usr/local/bin/pip", line 6, in <module>
from pkg_resources import load_entry_point
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 3241, in <module>
#_call_aside
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 3225, in _call_aside
f(*args, **kwargs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 3254, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 585, in _build_master
return cls._build_from_requirements(__requires__)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 598, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 786, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pip==20.0.2' distribution was not found and is required by the application```
My guess is that you have more than one soft links of pip in your default directory. Maybe try checking it by where pip3 and rm the soft links of older versions.
I recently updated my Homebrew installation of Python 3.8.2 to 3.8.3. After doing so, I ran
$ pip3 install -U pip
in order to check for any pip updates. It updated my installation of pip from 20.0.2 to 20.1.1, and ever since I ran that command, pip throws an error any time I try to use it. Here's the error:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 584, in _build_master
ws.require(__requires__)
File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 901, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 792, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.VersionConflict: (pip 20.1.1 (/usr/local/lib/python3.8/site-packages), Requirement.parse('pip==20.0.2'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/opt/python#3.8/bin/pip3", line 6, in <module>
from pkg_resources import load_entry_point
File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3255, in <module>
def _initialize_master_working_set():
File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3238, in _call_aside
f(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3267, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 586, in _build_master
return cls._build_from_requirements(__requires__)
File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 599, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 787, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pip==20.0.2' distribution was not found and is required by the application
It seems that something went wrong during the upgrade process that failed to change the version check within the code. I saw this similar question, but the accepted answer is not working for me. How can I make pip usable again?
As per Python documentation, the correct way to use pip now would be via the correct Python executable, e.g.
python3 -m pip install -U pip
I had experienced a similar problem on my Ubuntu and here's how I solved my problem:
First restore the older version by reinstalling it from your OS package manager (You may need to uninstall first).
Upgrade to the latest version for your user (as opposed to installing in a system location) with the following command
pip3 install --user -U pip
Hope this helps.
I am having some trouble deploying my elastic beanstalk app from a bitbucket pipeline. This same code had been working without issue, so my best guess is some kind of dependency issue.
(awsebcli version 3.14.1)
The image for the pipeline is python:3.5.2
and here's the failing step:
- step:
name: Test Deploy
deployment: test
caches:
- pip
script:
- pip install awsebcli --upgrade
- eb init myAppName -r us-east-1 -p Python # This line started failing :'(
- eb deploy myAppName-dev-1
and the error output:
eb init myAppName -r us-east-1 -p Python
Traceback (most recent call last):
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 570, in _build_master
ws.require(__requires__)
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 888, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 779, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (PyYAML 4.1 (/usr/local/lib/python3.5/site-packages), Requirement.parse('PyYAML<4,>=3.10'), {'docker-compose'})
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/eb", line 6, in <module>
from pkg_resources import load_entry_point
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 3095, in <module>
#_call_aside
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 3079, in _call_aside
f(*args, **kwargs)
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 3108, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 572, in _build_master
return cls._build_from_requirements(__requires__)
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 585, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 779, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (PyYAML 4.1 (/usr/local/lib/python3.5/site-packages), Requirement.parse('PyYAML<4,>=3.10'), {'docker-compose'})
So if I'm reading this right, I have PyYAML 4.1 when I need something less than 4.
I changed the pip install line to explicitly use an older version of PyYAML and that seems to have worked...
Changed
pip install awsebcli --upgrade
To
pip install pyYAML==3.12 awsebcli --upgrade
I am receiving an error when I want to install the ruamel.yaml package
Here is the command:
python --version;pip --version;pip install ruamel.yaml
And the output:
Python 2.7.10
pip 10.0.0 from /Library/Python/2.7/site-packages/pip (python 2.7)
Collecting ruamel.yaml
Downloading https://files.pythonhosted.org/packages/c1/ad/9557a78f1b61951623c56225e05dacdd81f80519f13fc39a926a5793edfa/ruamel.yaml-0.15.37.tar.gz (280kB)
100% |████████████████████████████████| 286kB 4.4MB/s
Complete output from command python setup.py egg_info:
sys.argv ['-c', 'egg_info', '--egg-base', 'pip-egg-info']
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/8j/69k5q3yn4y51g5nt2g7g9b9n24s68p/T/pip-install-htyM8C/ruamel.yaml/setup.py", line 917, in <module>
main()
File "/private/var/folders/8j/69k5q3yn4y51g5nt2g7g9b9n24s68p/T/pip-install-htyM8C/ruamel.yaml/setup.py", line 905, in main
setup(**kw)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 111, in setup
_setup_distribution = dist = klass(attrs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/dist.py", line 272, in __init__
_Distribution.__init__(self,attrs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 287, in __init__
self.finalize_options()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/dist.py", line 326, in finalize_options
ep.require(installer=self.fetch_build_egg)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 2385, in require
reqs = self.dist.requires(self.extras)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 2617, in requires
dm = self._dep_map
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 2606, in _dep_map
if invalid_marker(marker):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 1424, in is_invalid_marker
cls.evaluate_marker(text)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 1549, in _markerlib_evaluate
env = cls._translate_metadata2(_markerlib.default_environment())
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 1537, in _translate_metadata2
for key, value in env
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 1536, in <genexpr>
(key.replace('.', '_'), value)
ValueError: too many values to unpack
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/8j/69k5q3yn4y51g5nt2g7g9b9n24s68p/T/pip-install-htyM8C/ruamel.yaml/
To give a bit of a background. I installed python3 with brew and I uninstalled it thereafter.
Now I cannot install ruamel.yaml
Has anybody had the same issue?
How did you solve it?
You should do a pip list and check your version of setuptools should be (28.8.0). If you have an older version, upgrade with pip install -U setuptools.
You should consider upgrading from 2.7.10 to a newer version of Python 2 (currently 2.7.14), which should solve your SSL problems. Make sure you don't overwrite the system python if you are running on Linux.
I was able to resolve this by downgrading the python version from 3.10.+ to 3.9.+
I am trying to install Trac on windows (64-bit) and i have followed all the installation guidelines.
But when i try to run the trac standalone server using tracd, i get this error:
PS C:\Python27\Scripts> .\tracd.exe --port 8000 D:\TracEnv\
Traceback (most recent call last):
File "C:\Python27\Scripts\tracd-script.py", line 5, in <module>
from pkg_resources import load_entry_point
File "build\bdist.win-amd64\egg\pkg_resources\__init__.py", line 2927, in <module>
File "build\bdist.win-amd64\egg\pkg_resources\__init__.py", line 2913, in _call_aside
File "build\bdist.win-amd64\egg\pkg_resources\__init__.py", line 2940, in _initialize_master_working_set
File "build\bdist.win-amd64\egg\pkg_resources\__init__.py", line 635, in _build_master
File "build\bdist.win-amd64\egg\pkg_resources\__init__.py", line 943, in require
File "build\bdist.win-amd64\egg\pkg_resources\__init__.py", line 829, in resolve
pkg_resources.DistributionNotFound: The 'trac==1.0' distribution was not found and is required by the application
I have installed trac and it is present in the site package directory where i installed python.
-a--- 4/15/2016 4:25 PM 1894048 trac-1.0-py2.7.egg
So why is it not able to find trac?
i do not have admin access on this PC. I do not know python, i just want to install and learn how to use Trac.