Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkg_resources.DistributionNotFound: requests #36

Open
gavmckee80 opened this issue Jul 29, 2019 · 6 comments
Open

pkg_resources.DistributionNotFound: requests #36

gavmckee80 opened this issue Jul 29, 2019 · 6 comments

Comments

@gavmckee80
Copy link

I've just built the VM on macos, for VMWare fusion

python2.7 ./create-ztpserver.py -H vmware -o ubuntu --vmname ztpserver

The VM builds sucessfully , however when I try to start the ztp server I get the following traceback.

ztpsadmin@ztps:~$ ztps
Traceback (most recent call last):
File "/usr/local/bin/ztps", line 4, in
import pkg_resources
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2707, in
working_set.require(requires)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 686, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 584, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: requests

Any ideas how to help here ?

@gavmckee80
Copy link
Author

Adding packer debug log file
packer-debug.log

@cheynearista
Copy link

@gavmckee80 Do you have package request installed?
pip show requests

@gavmckee80
Copy link
Author

gavmckee80 commented Jul 29, 2019

@cheynearista
ztpsadmin@ztps:~$ pip freeze
Warning: cannot find svn location for distribute==0.6.24dev-r0
GnuPGInterface==0.3.2
apt-xapian-index==0.44
argparse==1.2.1
chardet==2.0.1
command-not-found==0.2.44
FIXME: could not find svn URL in dependency_links for this package:
distribute==0.6.24dev-r0
language-selector==0.1
python-apt==0.8.3ubuntu7.3
python-debian==0.1.21ubuntu1
ufw==0.31.1-1
wsgiref==0.1.2
ztpserver==1.3.2

@gavmckee80
Copy link
Author

gavmckee80 commented Jul 29, 2019

@cheynearista
image
I've also tested building a Fedora based image - looks like this goes sour during the install phase

@gavmckee80
Copy link
Author

@cheynearista

I think this is an install issue with the requests lib
ztpsadmin@ztps:/usr/share/ztpserver/files/lib$ ls
requests-2.3.0.tar.gz

I see the tar file is there , I do a manual install by unzipping into /tmp and then sudo pip install .

That successfully installs - but it shifts now to a different missing lib (PyYaml)

ztpsadmin@ztps:/$ ztps
Traceback (most recent call last):
File "/usr/local/bin/ztps", line 4, in
import pkg_resources
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2707, in
working_set.require(requires)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 686, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 584, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: pyyaml

So I think this is something fundamental going wrong in the build process

@gavmckee80
Copy link
Author

gavmckee80 commented Jul 30, 2019

To fix this I had to do the following
sudo pip install --index-url=https://pypi.python.org/simple/ pyyaml
sudo pip install --index-url=https://pypi.python.org/simple/ routes
sudo pip install --index-url=https://pypi.python.org/simple/ webob

Maybe we could get these steps integrated to the build, I think this could just be a problem with the fact that I have to specify the --index-url= option as https . As these packages are mentioned in the requirements.txt file and not specifying the option leads to an error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants