-
Notifications
You must be signed in to change notification settings - Fork 25
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
Installing in Python 2.6.5 yields: No such file or directory: 'README.rst' #57
Comments
I am able to reproduce an error using the technique you described above
Now, in the container, I run the apt install command:
and then the pip install command: root@c61dc7d3d87c:/# sudo pip install --log=/tmp/pip-install-bitmath.log bitmath
Downloading/unpacking bitmath
Downloading bitmath-1.3.0.2.tar.gz (80Kb): 80Kb downloaded
Exception:
Traceback (most recent call last):
File "/usr/lib/python2.6/dist-packages/pip.py", line 252, in main
self.run(options, args)
File "/usr/lib/python2.6/dist-packages/pip.py", line 408, in run
requirement_set.install_files(finder, force_root_egg_info=self.bundle)
File "/usr/lib/python2.6/dist-packages/pip.py", line 1757, in install_files
self.unpack_url(url, location)
File "/usr/lib/python2.6/dist-packages/pip.py", line 1901, in unpack_url
self.unpack_file(temp_location, location, content_type, link)
File "/usr/lib/python2.6/dist-packages/pip.py", line 1919, in unpack_file
self.untar_file(filename, location)
File "/usr/lib/python2.6/dist-packages/pip.py", line 1988, in untar_file
fp = tar.extractfile(member)
File "/usr/lib/python2.6/tarfile.py", line 2122, in extractfile
tarinfo))
File "/usr/lib/python2.6/tarfile.py", line 2105, in extractfile
if tarinfo.isreg():
AttributeError: 'NoneType' object has no attribute 'isreg'
Storing complete log in ./pip-log.txt
Traceback (most recent call last):
File "/usr/bin/pip", line 3, in <module>
pip.main()
File "/usr/lib/python2.6/dist-packages/pip.py", line 893, in main
return command.main(initial_args, args[1:], options)
File "/usr/lib/python2.6/dist-packages/pip.py", line 266, in main
logger.fatal('Storing complete log in %s' % log_fn)
File "/usr/lib/python2.6/dist-packages/pip.py", line 3353, in fatal
self.log(self.FATAL, msg, *args, **kw)
File "/usr/lib/python2.6/dist-packages/pip.py", line 3378, in log
consumer.write(rendered+'\n')
ValueError: I/O operation on closed file And the log file:
I'm not sure what all that means yet. I'm going to examine this closer later today or tomorrow. Thanks for the report, I'll get back to you asap. I did notice one thing though, the python version on that 10.04 host is |
Awesome, I've been attempting to tackle it as well, if and when I do get clou I'll let you know or send in a PR. On the python version part; I looked at the classifiers in the setup.py which lists 2.6 (among others) as a valid Python version. When installing bitmath from source Python 2.6 seems to work (at least partially) as my unittests checking some MB-GB conversions are all running well. |
Oh snap! I forgot about the classifiers, too. Ill poke at this for a while today. Surely one of us will find a good
|
Hm. It's not a fix, but I was able to get the package installed from pip. Sorta... Here's what I found (and don't understand). Maybe this is the same process you followed to install it. Straight pip install - Error
Pip Install With Source gz - Error
Python setup.py Install With Source gz DECOMPRESSED - Success:
In this final way (above), bitmath installed by:
This is so strange to me. Just earlier this year in commit 0978c32 (or 883b411) we were able to make some changes that fixed 2.6 compat in unittests. Why won't this install FROM pip? Why is the tar utility not recognizing the
and subsequent
Error. |
Jackpot; the issue is cause by the use of symlinks in the project: # git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
(use "git add/rm <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
deleted: docsite/source/NEWS.rst
deleted: docsite/source/full_demo.py
deleted: tests/listdir_symlinks/10_byte_file_link Steps to reproduce an succes: # Mount the bitmath project under /app
root@test01:~/projects/bitmath # docker --rm -it -v $(pwd):/app ubuntu:10.04 /bin/bash
root@e8c8310f5b35:/ # apt-get update && apt-get -y install python-pip
root@e8c8310f5b35:/ # cd /app/
root@e8c8310f5b35:/app # find ./ -type l -delete
root@e8c8310f5b35:/app # python setup.py sdist
root@e8c8310f5b35:/app # pip install dist/bitmath-1.3.0.2.tar.gz
root@e8c8310f5b35:/app # pip freeze
bitmath==1.3.0.2
distribute==0.6.10
wsgiref==0.1.2 |
WHOA! That's a brilliant find! Nice, Henk! I suspected something like that too, from some internet review. Never I'm going to reproduce your new test case and then see if i can find some
|
I just did some more internet scouring. Since this works in different versions I suspected somewhere in time that either the tarfile module or pip itself changed some fundamental behavior. There were no Changed in type notes between the Python 2.6 and 2.7 tarfile docs about changing symlink handling. So I checked out pip instead. In our reference container ( Check out the pip Release Notes page. Latest version is 8.1.2 from 2016-05-10. The version in 10.04 is laughably out of date. Aside: The first release with a date is actually their 1.0 release (early 2011). If you look through git hard enough you can eventually find commit pypa/pip@d5b6bbe on Jan 29, 2009 where the release string changes from BUT, going back to the release notes, there is a little gem in there. Find the
The suggested patch in that issue actually was merged in PR #293. Hm. Now to find a work around. |
I was able to reproduce the test you gave in your last comment @hkraal (did have to add the |
Now I gotta just figure out what to do about the symlink in the tests directory. That's kind of, well, required for tests. I guess the test dir doesn't need to be included for PyPi distributions. I just need see if excluding |
Yep. As expected. Removing the
Ran 0 tests... |
Hm. I got a hacky work-around in place that generates setup.py files for RPM vs. PyPi distribution. bitmath-1.3.0.3 is up on Test PyPi now In the ubuntu:10.04 container I install python-pip and then install bitmath from TEST pypi like this:
There's a weird error message there about regex group matching. I think it's possibly related to pypa/pip#366 which must have been fixed in a later version of pip than what's in ubuntu 10.04. One other issue though,
Install
@hkraal can you give this a test for me (Install bitmath 1.3.0.3 from test pypi)
|
Whoa, nice digging! Although I'm getting an error thrown at me the package does install and seems to be functional when running it inside a docker container. The bitmath==1.3.0.3 package would mark this issue as fixed as far as I'm concerned, fixing the error below is a nice to have but not required for me personally. root@2037a67741c3:/# pip install -i https://testpypi.python.org/pypi bitmath
Downloading/unpacking bitmath
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.6/threading.py", line 532, in __bootstrap_inner
self.run()
File "/usr/lib/python2.6/threading.py", line 484, in run
self.__target(*self.__args, **self.__kwargs)
File "/usr/lib/python2.6/dist-packages/pip.py", line 1115, in _get_queued_page
for link in page.rel_links():
File "/usr/lib/python2.6/dist-packages/pip.py", line 2226, in rel_links
for url in self.scraped_rel_links():
File "/usr/lib/python2.6/dist-packages/pip.py", line 2253, in scraped_rel_links
url = match.group(1) or match.group(2) or match.group(3)
IndexError: no such group
Downloading bitmath-1.3.0.3.tar.gz (64Kb): 64Kb downloaded
Running setup.py egg_info for package bitmath
Installing collected packages: bitmath
Running setup.py install for bitmath
Installing bitmath script to /usr/local/bin
Successfully installed bitmath Because the core of this issue is related to a old (ancient might be a better term) pip version I tried another route by installing pip using $ docker run -it --rm -v $(pwd):/app ubuntu:10.04 /bin/bash
root@63e4552d5b43:/# apt-get update && apt-get -y install curl
root@63e4552d5b43:/# curl https://bootstrap.pypa.io/get-pip.py | python
root@63e4552d5b43:/# pip install bitmath
DEPRECATION: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of pip will drop support for Python 2.6
Collecting bitmath
Downloading bitmath-1.3.0.2.tar.gz (80kB)
100% |################################| 81kB 5.6MB/s
Building wheels for collected packages: bitmath
Running setup.py bdist_wheel for bitmath ... done
Stored in directory: /.cache/pip/wheels/c3/c9/48/1d56019ad668467ba26ce61f7f9d987f621b4b1ed33a1c5695
Successfully built bitmath
Installing collected packages: bitmath
Successfully installed bitmath-1.3.0.2 And it run without a hitch as well |
Hooooooooooooooooooooooooooooooooooooooooooooold up. I've seen your log output happen to me once too, in a sort of way. Look close at the end there. Look close:
That must have came from the production pypi repository. Does get-pip.py support the
|
I've installed the latest Pip version using the installed rather than the Ubuntu package manager's Pip. This way we don't run into the old Pip version bug surrounding symlinks and your 1.3.0.2 version installs without any hassle. So we've go 2 options to choose from to solve this problem:
|
@tbielawa Is there anything I can do to help with this issue? Would you like to close it and be done with it or should we keep going for a working solution? |
Since that's quite an old system we're taking about I'm going to put the But I think the least we can do is make a note in the install instruction I've been thinking about putting my debian packaging hat back on for a
|
@hkraal docs are updated. You can see the note about pypi on the readthedocs page http://bitmath.readthedocs.io/en/latest/ as well as in the README for the project. |
I was testing an application using Ubuntu 10.04 running on docker which couldn't install bitmath.
System info
Reproduce:
The text was updated successfully, but these errors were encountered: