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

pip install doesn't work. #179

Closed
j00bar opened this issue Aug 26, 2013 · 20 comments · Fixed by #219
Closed

pip install doesn't work. #179

j00bar opened this issue Aug 26, 2013 · 20 comments · Fixed by #219

Comments

@j00bar
Copy link

j00bar commented Aug 26, 2013


/venv/bin/pip run on Mon Aug 26 16:12:22 2013
Downloading/unpacking err

Getting page https://pypi.python.org/simple/err/
URLs to search for versions for err:

Downloading/unpacking 3to2

Running setup.py egg_info for package 3to2

Installing collected packages: 3to2

Running setup.py install for 3to2

changing mode of build/scripts-2.7/3to2 from 664 to 775



changing mode of /venv/bin/3to2 to 775

Successfully installed 3to2

Cleaning up...

Traceback (most recent call last):

File "", line 16, in

File "/venv/build/err/setup.py", line 105, in

File "/venv/build/err/setup.py", line 91, in setup_python2

File "/usr/lib/python2.7/shutil.py", line 169, in copytree

names = os.listdir(src)

OSError: [Errno 2] No such file or directory: 'errbot'


Command python setup.py egg_info failed with error code 1 in /venv/build/err

Exception information:
Traceback (most recent call last):
File "/venv/local/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/basecommand.py", line 139, in main
status = self.run(options, args)
File "/venv/local/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/commands/install.py", line 266, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/venv/local/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/req.py", line 1057, in prepare_files
req_to_install.run_egg_info()
File "/venv/local/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/req.py", line 236, in run_egg_info
command_desc='python setup.py egg_info')
File "/venv/local/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/util.py", line 662, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command python setup.py egg_info failed with error code 1 in /venv/build/err

@zoni
Copy link
Member

zoni commented Aug 26, 2013

Hmmm... That's really strange. I can reproduce this with a Python 2.7 virtualenv, but I'm quite certain it's worked before though.

If you have Python 3.x, I can confirm that it still installs fine for Python 3 though.

@omarish
Copy link

omarish commented Sep 19, 2013

Same here - can't install with Python 2.7.

@fxdgear
Copy link

fxdgear commented Oct 2, 2013

3rd-ed

@gbin
Copy link
Member

gbin commented Oct 3, 2013

I have just uploaded a beta2, can you try again ?

I could install it under ubuntu python 2.7 but NOT under a virtualenv (it is a shame but we are going to fix this also)

@davidrizzuto
Copy link

I can install it fine, but it's broken due to the version number

ValueError: version 2.0.0-beta2 in not in format "x.y.z" or "x.y.z-{beta,alpha,rc1,rc2...}" for example "1.2.2"

this stops any plugin from loading.

But good job with the release - fix up the version number and I'll be super happy :)

@gbin
Copy link
Member

gbin commented Oct 4, 2013

Arf, doh, I might simply make an rc1 then ;)

@gbin
Copy link
Member

gbin commented Oct 4, 2013

here we go

@davidrizzuto
Copy link

Excellent! Up and running on my system. Thanks for the quick turnaround!

@ekohl
Copy link

ekohl commented Oct 9, 2013

It's interesting that you can use pip install . on a git clone inside a virtualenv (though I had some odd issue with six on the first try).

The error I saw when I installed with pip install err==2.0.0-rc1 was from shutil.copytree(d, tmp_src) on errbot so I suspect that it's executed from the wrong directory or should use the absolute path. Most likely you need to find the temporary directory where pip installs the sources to and determine the absolute path from there.

zoni pushed a commit to zoni/errbot that referenced this issue Nov 27, 2013
This should finally fix all the issues from errbotio#179
zoni pushed a commit to zoni/errbot that referenced this issue Nov 27, 2013
This should finally fix all the issues from errbotio#179
zoni pushed a commit to zoni/errbot that referenced this issue Nov 27, 2013
This should finally fix all the issues from errbotio#179
zoni pushed a commit to zoni/errbot that referenced this issue Nov 27, 2013
This should finally fix all the issues from errbotio#179
zoni pushed a commit to zoni/errbot that referenced this issue Nov 27, 2013
This should finally fix all the issues from errbotio#179
@zoni
Copy link
Member

zoni commented Nov 27, 2013

This is actually quite a tough and nasty one. I had it working partially by using absolute paths in a few places, but then setup steps on dependencies suddenly started failing :(

What's most frustrating is that with some changes, it would install fine when doing python /path/to/err/repo/setup.py install which with the current master branch also doesn't work, but yet it wouldn't work when packaged up or installed from the GitHub archive.zip links.

@daenney
Copy link
Contributor

daenney commented Nov 28, 2013

Isn't this because zip_safe isn't set to False? Normally you can't do things on files in the archive etc from setup.py unless you're using pkgutil.get_data(). It might only apply to datafiles etc, not entirely clear on that, pkgutil is always a bit of a mystery.

On a side note, how difficult would it be to get rid of 3to2? Since we only support 2.7 and 3.3 we can probably do without it which should take care of the weird stuff breaking setup.py.

@gbin
Copy link
Member

gbin commented Nov 28, 2013

@daenney interesting, can you try it out ? The zip safe thing was put as a quick fix ... And it stayed :)

@daenney
Copy link
Contributor

daenney commented Nov 28, 2013

If I set zip_safe=False and then do a python setup.py sdist it packages up correctly. When I then try to install it on Python 2.7 I get this:

npacking ./err-2.0.0-rc2.tar.gz
  Running setup.py egg_info for package from file:///private/tmp/err-2.0.0-rc2.tar.gz
    Downloading/unpacking 3to2
      Running setup.py egg_info for package 3to2

    Installing collected packages: 3to2
      Running setup.py install for 3to2
        changing mode of build/scripts-2.7/3to2 from 644 to 755

        changing mode of /Users/daenney/.virtualenv/envs/err-py27-installtest/bin/3to2 to 755
    Successfully installed 3to2
    Cleaning up...
    Traceback (most recent call last):
      File "<string>", line 16, in <module>
      File "/var/folders/qw/pp2t18f154564t3b04m2wpm00000gp/T/pip-X_LrxJ-build/setup.py", line 106, in <module>
        src_root = setup_python2()
      File "/var/folders/qw/pp2t18f154564t3b04m2wpm00000gp/T/pip-X_LrxJ-build/setup.py", line 92, in setup_python2
        shutil.copytree(d, tmp_src)
      File "/usr/local/opt/pyenv/versions/2.7.5/lib/python2.7/shutil.py", line 171, in copytree
        names = os.listdir(src)
    OSError: [Errno 2] No such file or directory: 'tests'
    Complete output from command python setup.py egg_info:
    Downloading/unpacking 3to2

  Running setup.py egg_info for package 3to2



Installing collected packages: 3to2

  Running setup.py install for 3to2

    changing mode of build/scripts-2.7/3to2 from 644 to 755



    changing mode of /Users/daenney/.virtualenv/envs/err-py27-installtest/bin/3to2 to 755

Successfully installed 3to2

Cleaning up...

Traceback (most recent call last):

  File "<string>", line 16, in <module>

  File "/var/folders/qw/pp2t18f154564t3b04m2wpm00000gp/T/pip-X_LrxJ-build/setup.py", line 106, in <module>

    src_root = setup_python2()

  File "/var/folders/qw/pp2t18f154564t3b04m2wpm00000gp/T/pip-X_LrxJ-build/setup.py", line 92, in setup_python2

    shutil.copytree(d, tmp_src)

  File "/usr/local/opt/pyenv/versions/2.7.5/lib/python2.7/shutil.py", line 171, in copytree

    names = os.listdir(src)

OSError: [Errno 2] No such file or directory: 'tests'

----------------------------------------
Cleaning up...

So baww.

@daenney
Copy link
Contributor

daenney commented Nov 28, 2013

I started trying to convert the sources to just 2.7/3.3 native compatible but there's a lot of places where you guys do str() crap 😛.

@gbin
Copy link
Member

gbin commented Nov 29, 2013

Yeah I use copytree here, we would need to replace that by a compatible function for the packaged version.
We decided to go for a pure clean py3 code and the plan is to drop py2.

@daenney
Copy link
Contributor

daenney commented Nov 29, 2013

Right, that makes sense. I still don't get entirely what's tripping up the setup.py. shutil.copytree works just fine on 2.7, it's the OSError that's freaking me out.

@sijis
Copy link
Contributor

sijis commented Dec 4, 2013

This is what I've noticed ...

  • when running python ./setup.py sdist everything completes. (I do see a warning about the refactoringtool for webserver.py, but that doesn't seem to be a factor)
  • the compiled tar.gz file in dist/ directory doesn't have a tests/ directory. i'm not sure if that's expected or not, but since tests is in variables src_dirs in setup.py i find it odd
  • when trying to install the tar.gz file with pip install dist/err-2.0.0-rc2.tar.gz, it fails. The main thing to note is that error mentions that the 'tests' directory is missing.

As a side note, i did change setup.py to use distutils.dir_utils copy_tree and remove_tree to rule out something with shutil.copytree but that doesn't appear to be the problem.

@daenney
Copy link
Contributor

daenney commented Dec 4, 2013

@sijis Thanks! I hadn't actually thought about looking at that, the error makes so much sense now. I think I also know how to fix it.

@sijis
Copy link
Contributor

sijis commented Dec 4, 2013

Great! Im guessing its something with the py2_root variable?

zoni pushed a commit to zoni/errbot that referenced this issue Dec 26, 2013
Without this option, calling pip while setup.py install is being run
results in pip deleting the build directory, causing the entire install
process to fail with difficult to debug errors about files being
missing. This fixes errbotio#179
@zoni
Copy link
Member

zoni commented Dec 26, 2013

I finally figured this out. The solution is so glaringly obvious in the end. headdesks

@gbin can we merge the associated pull request and issue a new release soon? Current version on PyPi is still uninstallable for many people on Python 2. (I'm not sure what causes this to trigger where it didn't before, I'm thinking it's just the most recent versions of pip, but I'm not certain.)

@gbin gbin closed this as completed in #219 Dec 29, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants