I am switching from Linux to OSX and when I run our build's setup.py script, I get an error message that contains the text
This script requires setuptools version 0.6c7.
I have tried several times to install setuptools, and have verified that the setuptools egg exists in /Library/Python/2.6/site-packages. I have no idea why it is not being recognized.
It is very common to have multiple versions of Python on OS X systems. In recent releases of OS X, Apple has shipped two versions itself (in /usr/bin). You may have installed more recent versions using installers from python.org (which generally exist in /Library/Frameworks/Python.framework or using a package distributor like MacPorts (which install in /opt/local/Library/Frameworks/Python.framework). Keep in mind that each version of Python requires its own copy of setuptools.
Since the site package path you report is /Library/Python/2.6/site-packages, it is most likely you have used the Apple-supplied Python 2.6.1 in OS X 10.6 to try to install a new version of setuptools. Note that Apple already supplies setuptools for its Pythons (0.6c9 for 2.6.1 in 10.6); the corresponding easy_install commands are in /usr/bin.
$ /usr/bin/python2.6 -c 'import setuptools;print(setuptools.__file__,setuptools.__version__)'
('/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/setuptools/__init__.pyc', '0.6c9')
If you are using another non-Apple-supplied Python, follow the instructions to install a new version of setuptools (or Distribute) making sure you are invoking the right version of Python. Check your shell PATH and which python to make sure.
If that doesn't help, update your question with more information.
UPDATE: Based on your further comments, it seems something was amiss in your default site-packages directory. With that problem out of the way and having established that there is an Apple-supplied setuptools version 0.6c9 installed, it appears the package you are trying to install is looking for a specific, earlier version of setuptools, 0.6c7. If that is the case, you should first determine why that is and if it is necessary. Chances are that it is just an incorrect version specification in the package's setup.py file, i.e. using == rather than >=. If you can, edit the setup.py so it can use a newer version. In the unlikely event that the package really does need that specific older version of setuptools (which may not even work with that version of Python or OS X), you could try installing the older version, like so:
$ sudo /usr/bin/easy_install-2.6 setuptools==0.6c7
$ /usr/bin/python2.6 -c 'import setuptools;print(setuptools.__file__,setuptools.__version__)'
('/Library/Python/2.6/site-packages/setuptools-0.6c7-py2.6.egg/setuptools/__init__.pyc', '0.6c7')
But you really should avoid doing that if at all possible as that will install another older version of easy_install in /usr/local/bin and could cause problems with installing and using other packages.
Have you tried to import setuptools in your setup.pyscript?
import setuptools
This solved my setuptool-ish build problems in the past.
Related
I have upgrade from python 3.9.6 to 3.10.5 and kept thankfully the old version. This is on a Win-64 machine so should be using the WinVault backend (default)
I have copied all the site_packages from 3.9.6 to 3.10.5 (except for those already installed by the newer version)
Running keyring under 3.10.05 the error is
keyring.errors.NoKeyringError: No recommended backend was available. Install a recommended 3rd party backend package; or, install the keyrings.alt package if you want to use the non-recommended backends. See https://pypi.org/project/keyring for details.
I can run the same code under 3.9.6 with no problems.
Running
python -c "import keyring.util.platform_; print(keyring.util.platform_.config_root())"
or
python -c "import keyring.util.platform_; print(keyring.util.platform_.data_root())"
under either version is producing locations that don't really exist. I have created a keyringrc.cfg file with a keyring.backends.Windows.WinVaultKeyring line but it doesn't seem to do anything
I don't mind having to re-enter keyring passwords but would like to get this working under 3.10.5.
Ideas
This has eventually turned out to be needs to upgrade cffi which has fixed the problem.
I recently deleted the default python version on Fedora 31 and installed python 3.9 then made it as default, now I have multiple versions of python.
If I type: whereis python in my terminal this list appear:
python: /usr/bin/python /usr/bin/python3.9 /usr/bin/python3.7 /usr/bin/python3.9-config /usr/bin/python3.7m /usr/bin/python3.9-x86_64-config /usr/lib/python3.9 /usr/lib/python2.6 /usr/lib/python3.7 /usr/lib64/python3.9 /usr/lib64/python3.7 /usr/local/bin/python3.7m-config /usr/local/bin/python3.7 /usr/local/bin/python3.7m /usr/local/lib/python3.7 /usr/include/python3.9 /usr/include/python3.7m /usr/share/man/man1/python.1.gz /usr/src/Python-3.7.4/python
If I type pip then I get ModuleNotFoundError: No module named 'pip'
Also multiple packages are broken such as dnf, argcomplete, pip, etc.
I cannot update or install anything.
How can I solve this problem ?
Grab/Download the original python RPMs for your distro and reinstall them that way if they're not still cached under /var ....
With Python 3.9 you should use pip3...So install python3-pip.
That should do the trick
I tried many solutions and didn't work, however I ended up backing up my data and completely deleting the OS, then I downloaded the last version of fedora and restored my data on it.
thanks for your time
I ran into this unfortunate situation as well on Fedora 35. dnf, yum, and a bunch of other things broke.
I didn't manage to get Python 3.10 back through dnf, yum, or apt-get. I downloaded the rpm from https://fedora.pkgs.org/35/fedora-x86_64/python3-3.10.0-1.fc35.x86_64.rpm.html. It did require a dependency of python3-libs which I downloaded from: https://fedora.pkgs.org/35/fedora-x86_64/python3-libs-3.10.0-1.fc35.x86_64.rpm.html.
I installed python3-libs first with sudo rpm -i python3-libs-3.10.0-1.fc35.x86_64.rpm --force as there were some file writing conflicts. I ran the same command for the python3.10 rpm with the --force flag as well since there were 2 conflicts. After that, everything worked perfectly! Managed to dodge having to do a full reinstall.
I am just starting with virtualenv, but I am trying to install gevent within a virtualenv environment (I am running Windows). When I use PIP from virtualenv, I get this error:
MyEnv>pip install gevent
Downloading/unpacking gevent
Running setup.py egg_info for package gevent
Please provide path to libevent source with --libevent DIR
The package index has MSIs and EXEs for installing on Windows (http://pypi.python.org/pypi/gevent/0.13.7), but I don't know how to install those into a virtualenv environment (or if that is even possible). When I try pip install gevent-0.13.7.win32-py2.7.exe from the virtualenv promp, I get an error as well:
ValueError: ('Expected version spec in', 'D:\\Downloads\\gevent-0.13.7.win32-py2.7.exe', 'at', ':\\Downloads\\gevent-0.13.7.win32-py2.7.exe')
Does someone know how to do this?
Pip doesn't support installing binary packages, yet. If you want to install from binary package you have to use easy_install - easy_install gevent-0.13.7.win32-py2.7.exe
Microsoft Windows XP [Wersja 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
Z:\>virtualenv z:\venv\gevent-install
New python executable in z:\venv\gevent-install\Scripts\python.exe
Installing distribute..................................................................................................
............................................................................................done.
Installing pip.................done.
Z:\>venv\gevent-install\Scripts\activate
(gevent-install) Z:\>easy_install c:\python\packages\gevent-0.13.7.win32-py2.7.exe
Processing gevent-0.13.7.win32-py2.7.exe
creating 'c:\docume~1\pdobro~1\ustawi~1\temp\easy_install-b5nj3i\gevent-0.13.7-py2.7-win32.egg' and adding 'c:\docume~1
pdobro~1\ustawi~1\temp\easy_install-b5nj3i\gevent-0.13.7-py2.7-win32.egg.tmp' to it
creating z:\venv\gevent-install\lib\site-packages\gevent-0.13.7-py2.7-win32.egg
Extracting gevent-0.13.7-py2.7-win32.egg to z:\venv\gevent-install\lib\site-packages
Adding gevent 0.13.7 to easy-install.pth file
Installed z:\venv\gevent-install\lib\site-packages\gevent-0.13.7-py2.7-win32.egg
Processing dependencies for gevent==0.13.7
Searching for greenlet
Reading http://pypi.python.org/simple/greenlet/
Reading http://bitbucket.org/ambroff/greenlet
Reading https://github.com/python-greenlet/greenlet
Best match: greenlet 0.3.4
Downloading http://pypi.python.org/packages/2.7/g/greenlet/greenlet-0.3.4-py2.7-win32.egg#md5=9941aa246358c586bb274812e
130629
Processing greenlet-0.3.4-py2.7-win32.egg
creating z:\venv\gevent-install\lib\site-packages\greenlet-0.3.4-py2.7-win32.egg
Extracting greenlet-0.3.4-py2.7-win32.egg to z:\venv\gevent-install\lib\site-packages
Adding greenlet 0.3.4 to easy-install.pth file
Installed z:\venv\gevent-install\lib\site-packages\greenlet-0.3.4-py2.7-win32.egg
Finished processing dependencies for gevent==0.13.7
(gevent-install) Z:\>
See Can I install Python windows packages into virtualenvs? Another option is to install from source and you can do this with pip but this requires setting up compiler and environment which is much harder than the simple command above.
From the error message, it would appear you need libevent source code. I would imagine you need to go a step further and compile/install libevent system-wide so pip can find it.
I would start by downloading the latest stable source from http://libevent.org/.
Compile and install it using instructions in the README: https://github.com/libevent/libevent#readme
To compile it on Windows, you'll need to use GNU-style build utilities like make and autoconf. I recommend http://www.mingw.org/.
Once you've installed libevent system-wide, I imagine pip will find it and proceed with gevent installation.
In the msi for gevent-0.13.7 there's an option to select an alternate installation point. point it to the root dir of your particular virtual environment (just above where /Lib and /Scripts are located). That should install it correctly.
You also need to make sure greenlets are installed. For that you can use Piotr's suggested method with easy_install on the .exe.
I'm getting errors when running
$ brew install postgresql
==> Downloading http://ftp.postgresql.org/pub/source/v9.1.2/postgresql-9.1.2.tar.bz2
File already downloaded in /Users/neil/Library/Caches/Homebrew
Warning: Detected a framework Python that does not have 64-bit support in:
/Library/Frameworks/Python.framework/Versions/Current/Python
e configure script seems to prefer this version of Python over any others,
you may experience linker problems as described in:
http://osdir.com/ml/pgsql-general/2009-09/msg00160.html
fix this issue, you may need to either delete the version of Python
own above, or move it out of the way before brewing PostgreSQL.
te that a framework Python in /Library/Frameworks/Python.framework is
e "MacPython" version, and not the system-provided version which is in:
/System/Library/Frameworks/Python.framework
==> ./configure --disable-debug --prefix=/usr/local/Cellar/postgresql/9.1.2 --datadir=/usr/local/Cellar/postgresql/9.1.2/shar
^C
Here's where python is located.
$ which python
/usr/local/bin/python
I modified my ~/.zshrc PATH from
export PATH=/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin
to
export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin
And although I'm getting python 64-bit errors, my version of python is 64-bit according to this SO post:
$ python -c 'import struct;print( 8 * struct.calcsize("P"))'
64
The problem pointed out in the referenced mailing list post is that the configure step isn't impacted by the PATH here. There's a whole other mechanism used to find things to link against; see Where do I set DYLD_LIBRARY_PATH on Mac OS X for a quick intro. You could try the suggested workaround given by the brew script--rename /Library/Frameworks/Python.framework/Versions/Current/Python to something else to get it out of the linker's search path, repeat the brew install, then put it back.
If you don't need Python bindings in your PostgreSQL, you can also just install it without Python bindings using brew install postgresql --no-python.
This command is installing the server, not the python bindings. Is that what you want? There is a installer for osx that will install the server for you.
Once you have done that, you can install the psycopg2 bindings directly from source.
This is partly a question, partly my own findings on what I found to be the issue when I encountered this error:
(cdbak)USER-MBP-2:.virtualenvs <YOUR_USER_NAME>$ pip
Traceback (most recent call last):
File "/Users/<YOUR_USER_NAME>/.virtualenvs/cdbak/bin/pip", line 6, in <module>
from pkg_resources import load_entry_point
ImportError: No module named pkg_resources
This issue arose when I tried to install pypsum via pip in my virtual environment for use with django.
(cdbak)USER-MBP-2:.virtualenvs <YOUR_USER_NAME>$ pip install pypsum
I have been working in virtual environments, so I was fortunate that after it broke, I could just reset my virtual environment with the script I had written.
I copied the output from the installation process and started looking closer into it and it seems like there is something that goes wrong in setuptools.
The installation process tries to build the package but it does not find build_py in the setuptools which causes it to 'patch' the setuptools installation by renaming the currently installed setuptools.
This is the part where I think funky stuff starts to happen:
Setuptools installation detected at /Users/<YOUR_USER_NAME>/.virtualenvs/cdbak/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg
Egg installation
Patching...
Renaming /Users/<YOUR_USER_NAME>/.virtualenvs/cdbak/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg into /Users/<YOUR_USER_NAME>/.virtualenvs/cdbak/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg.OLD.1321360113.04
And then it goes on to try and install another version of setuptools or so it seems:
After install bootstrap.
Creating /Users/<YOUR_USER_NAME>/.virtualenvs/cdbak/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg-info
Creating /Users/<YOUR_USER_NAME>/.virtualenvs/cdbak/lib/python2.7/site-packages/setuptools.pth
But it does not seem to install the setuptools package correctly in its current location and then results in a missing pkg_resources module (In fact, it is missing a lot of other things too)
[Setup]
OS: Mac OS X Lion
Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05)
virtualenv v1.6.1
Fresh virtual environment using virtualenvwrapper using requirements file to install these packages:
mercurial==1.9.3
Django>=1.3.1
MySQL-python>=1.2.3
Sphinx
wsgiref
pylint
yolk
dbgp
django-debug-toolbar
south
I was able to use pip to install other packages just fine but for some reason it seems to break with this installation.
[Question]
- Do people think this is a mistake with the installation process of this package?
- Or, is it a mistake with setuptools?
- Or, am I just installing it incorrectly?
[Extra Note]
I can attach the file with the entire output but its a long file and I decided to only extract the segments I felt were relevant. If you would like to view the full file, I can upload that too.
I'm not sure about all of your problems but there is at least one problem caused by the loremipsum package that is a dependency for the pypsum package. For some reason, in the setup.py file of loremipsum, the author includes specific requirements for the distribute package:
egg = {
'name': name,
'version': module.__version__,
'author': author,
'author_email': email.strip('<>'),
'url': url,
'description': "A Lorem Ipsum text generator",
'long_description': long_description,
'classifiers': module.__classifiers__,
'keywords': ['lorem', 'ipsum', 'text', 'generator'],
'setup_requires': ['distribute'],
'install_requires': ['distribute'],
'packages': [name],
# 'package_dir': {'': '.'},
# 'package_data': {'': 'default/*.txt'},
# 'data_files': [(name, ('default/dictionary.txt', 'default/sample.txt'))],
'include_package_data': True,
'test_suite': 'tests.suite' }
distribute, as you may know, is a fork of the setuptools package; there's a long history behind this. Since distribute is supposed to be an almost plug-compatible replacement for setuptools, it will try to masquerade as setuptools and disable any existing setuptools already installed in that Python instance. Thus, putting distribute in a setup.py file as a requirement is usually not a good idea. By default, virtualenv will install a version of setuptools but it does have an option to use distribute instead. The Apple-supplied system Pythons in OS X 10.6 and 10.7 already come with versions of setuptools pre-installed and, because they are in non-standard system directories, cannot be so easily patched around. A simple workaround when using virtualenv on OS X seems to be to also use its no-site-packages option which will prevent the setuptools version from the system Python interfering with the required distribute in the virtualenv. No doubt the confusion between distribute and setuptools is causing the problems seen with pkg_resources since it is also supplied by both of them.
So try re-creating your virtualenv this way:
virtualenv --distribute --no-site-packages /path/to/ve
That will also have the side-effect of not including the third-party packages that Apple ships with the system Python. You can add them back in with PYTHONPATH if you really need them but it's probably better to install separate versions.