collective / buildout.python

Buildout all the Pythons
109 stars 47 forks source link

Download error: unknown url type: https -- Some packages may not be found! #55

Closed aclark4life closed 7 years ago

aclark4life commented 8 years ago

I want to track and share my most recent workflow (on OS X 10.11) with buildout.python because I'd like this process to be much smoother:

At this point I notice I'm running setuptools 23 and stuck in a looping error:


 ~/Developer/buildout/buildout.python   master  virtualenv .
New python executable in /Users/alexclark/Developer/buildout/buildout.python/bin/python2.7
Also creating executable in /Users/alexclark/Developer/buildout/buildout.python/bin/python
Installing setuptools, pip, wheel...done.
 ~/Developer/buildout/buildout.python   master  bin/pip install zc.buildout==1.4.4
Collecting zc.buildout==1.4.4
Requirement already satisfied (use --upgrade to upgrade): setuptools in ./lib/python2.7/site-packages (from zc.buildout==1.4.4)
Installing collected packages: zc.buildout
Successfully installed zc.buildout-1.4.4
 ~/Developer/buildout/buildout.python   master  bin/buildout 
Creating directory '/Users/alexclark/Developer/buildout/buildout.python/eggs'.
/Users/alexclark/Developer/buildout/buildout.python/lib/python2.7/site-packages/pkg_resources/__init__.py:187: RuntimeWarning: You have iterated over the result of pkg_resources.parse_version. This is a legacy behavior which is inconsistent with the new version class introduced in setuptools 8.0. In most cases, conversion to a tuple is unnecessary. For comparison of versions, sort the Version instances directly. If you have another use case requiring the tuple, please file a bug with the setuptools project describing that need.
  stacklevel=1,
Getting distribution for 'buildout.extensionscripts'.
zip_safe flag not set; analyzing archive contents...
Got buildout.extensionscripts 1.0.
Creating directory '/Users/alexclark/Developer/buildout/buildout.python/parts'.
Creating directory '/Users/alexclark/Developer/buildout/buildout.python/develop-eggs'.
Getting distribution for 'setuptools==1.4.2'.
Got setuptools 1.4.2.
Upgraded:
  setuptools version 1.4.2;
restarting.
Generated script '/Users/alexclark/Developer/buildout/buildout.python/bin/buildout'.
/Users/alexclark/Developer/buildout/buildout.python/lib/python2.7/site-packages/pkg_resources/__init__.py:187: RuntimeWarning: You have iterated over the result of pkg_resources.parse_version. This is a legacy behavior which is inconsistent with the new version class introduced in setuptools 8.0. In most cases, conversion to a tuple is unnecessary. For comparison of versions, sort the Version instances directly. If you have another use case requiring the tuple, please file a bug with the setuptools project describing that need.
  stacklevel=1,
Upgraded:
  setuptools version 1.4.2;
restarting.

Next I downgrade to setuptools 1.4.2 with bin/pip install setuptools==1.4.2 to continue; bin/python bootstrap.py gets you this far, too. Then buildout.python fails on:

Installed /Users/alexclark/Developer/buildout/buildout.python/parts/opt/lib/python2.4/site-packages/setuptools-1.4.2-py2.4.egg
Processing dependencies for setuptools==1.4.2
Finished processing dependencies for setuptools==1.4.2
Searching for pip==1.1
Reading https://pypi.python.org/simple/pip/
Download error on https://pypi.python.org/simple/pip/: unknown url type: https -- Some packages may not be found!
Couldn't find index page for 'pip' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
Download error on https://pypi.python.org/simple/: unknown url type: https -- Some packages may not be found!
No local packages or download links found for pip==1.1
error: Could not find suitable distribution for Requirement.parse('pip==1.1')
New python executable in /Users/alexclark/Developer/buildout/buildout.python/python-2.4/bin/python2.4
Also creating executable in /Users/alexclark/Developer/buildout/buildout.python/python-2.4/bin/python
Installing setuptools.............done.
Installing pip...............done.
Searching for collective.dist
Reading http://pypi.python.org/simple/collective.dist/
Download error: unknown url type: https -- Some packages may not be found!
Couldn't find index page for 'collective.dist' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading http://pypi.python.org/simple/
Download error: unknown url type: https -- Some packages may not be found!
No local packages or download links found for collective.dist
Best match: None
Traceback (most recent call last):
  File "/Users/alexclark/Developer/buildout/buildout.python/python-2.4/bin/easy_install", line 7, in ?
    sys.exit(
  File "/Users/alexclark/Developer/buildout/buildout.python/python-2.4/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/setuptools/command/easy_install.py", line 1712, in main
    with_ei_usage(lambda:
  File "/Users/alexclark/Developer/buildout/buildout.python/python-2.4/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/setuptools/command/easy_install.py", line 1700, in with_ei_usage
    return f()
  File "/Users/alexclark/Developer/buildout/buildout.python/python-2.4/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/setuptools/command/easy_install.py", line 1716, in <lambda>
    distclass=DistributionWithoutHelpCommands, **kw
  File "/Users/alexclark/Developer/buildout/buildout.python/parts/opt/lib/python2.4/distutils/core.py", line 149, in setup
    dist.run_commands()
  File "/Users/alexclark/Developer/buildout/buildout.python/parts/opt/lib/python2.4/distutils/dist.py", line 946, in run_commands
    self.run_command(cmd)
  File "/Users/alexclark/Developer/buildout/buildout.python/parts/opt/lib/python2.4/distutils/dist.py", line 966, in run_command
    cmd_obj.run()
  File "/Users/alexclark/Developer/buildout/buildout.python/python-2.4/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/setuptools/command/easy_install.py", line 211, in run
    self.easy_install(spec, not self.no_deps)
  File "/Users/alexclark/Developer/buildout/buildout.python/python-2.4/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/setuptools/command/easy_install.py", line 434, in easy_install
    self.local_index
  File "/Users/alexclark/Developer/buildout/buildout.python/python-2.4/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/setuptools/package_index.py", line 475, in fetch_distribution
    return dist.clone(location=self.download(dist.location, tmpdir))
AttributeError: 'NoneType' object has no attribute 'clone'
python-2.4: Non zero exit code (1) while running command.
While:
  Installing python-2.4.
Error: Non zero exit code (1) while running command.

IIRC I've gotten this far before and I eventually remember the next trick to go further. I'll update this ticket when that happens.

mauritsvanrees commented 8 years ago

I notice this line:

Download error: unknown url type: https -- Some packages may not be found!

So you need another system package. I think openssl-dev.

aclark4life commented 8 years ago

@mauritsvanrees Even on OS X? You may be right… but that doesn't sound familiar yet. IIRC Homebrew Python 2.7 includes SSL. I don't have that machine handy, but here's what I see on a similar device where I succeeded in getting buildout.python working recently:

 ~  python
Python 2.7.11 (default, Dec 26 2015, 17:47:53) 
[GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl
>>> ssl.__file__
'/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.pyc'

(Also not sure if that is a valid test of SSL support.)

aclark4life commented 8 years ago
brew link openssl --force

Then start over; ensure /usr/local/bin/openssl is the response to which openssl instead of /usr/bin/openssl

seanupton commented 8 years ago

Using brew link seems preferable to what I have done recently:

SSL=$(brew --prefix openssl) \
CFLAGS="-I$SSL/include -I$(xcrun --show-sdk-path)/usr/include" \
LDFLAGS="-L$SSL/lib" \
./bin/buildout
aclark4life commented 7 years ago

And… this might be broken again within Homebrew 1.0:


Warning: Refusing to link: openssl
Linking keg-only openssl means you may end up linking against the insecure,
deprecated system OpenSSL while using the headers from Homebrew's openssl.
Instead, pass the full include/library paths to your compiler e.g.:
  -I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib

As far as I can tell, setting -I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib in src/python24.cfg doesn't help.