So I'm building a package with conda on Win7:
conda skeleton pypi $pkgname
conda build $pkgname
binstar upload ./conda-bld/win-64/$pkgname-py27_0.tar.bz2
conda install -c https://conda.binstar.org/myname $pkgname
With python2k, this works like a charm. However, using python3k this fails because the patch package is not available for python3k. Error (example for docopt):
$ conda skeleton pypi docopt
Using url https://pypi.python.org/packages/source/d/docopt/docopt-0.6.2.tar.gz (25 KB) for docopt.
Downloading docopt (use --no-download to skip this step)
Using cached download
Unpacking docopt...
done
working in C:\cygwin64\tmp\tmpy7erx8vyconda_skeleton_docopt-0.6.2.tar.gz
Fetching package metadata: ......
Solving package specifications: .
Applying patch: 'C:\\cygwin64\\tmp\\tmpy7erx8vyconda_skeleton_docopt-0.6.2.tar.gz\\pypi-distutils.patch'
Error:
Did not find 'patch' in: C:\Python\Anaconda3\envs\_build\Scripts;C:\Python\Anaconda3\Scripts;C:\cygwin\bin;C:\cygwin64\usr\local\bin;C:\cygwin64\bin;C:\Python\Python3\Lib\site-packages\PyQt4;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\MiKTeX 2.9\miktex\bin\x64;C:\cygwin64\bin;C:\Program Files (x86)\AMD\ATI.ACE\Core-Static;C:\Python\Anaconda3;C:\Python\Anaconda3\Scripts;C:\cygwin64\lib\lapack
You can install 'patch' using apt-get, yum (Linux), Xcode (MacOSX), or conda, cygwin (Windows)
When trying to install patch:
$conda search ^patch$
Fetching package metadata: ....
patch 1.12.11 py27_0 defaults
No patch package for python3k - does this mean no package building for me?
You can reuse the same recipe that you built with Python 2. Or you can create an environment with patch (conda create -n patch patch) and put it on your PATH. Or you can install patch from http://gnuwin32.sourceforge.net/packages/patch.htm.
Related
I want to download Python package pipy.org and move them to another machine and finally install that packages with downloaded .whl files in that machine
This is requirements.txt file:
amqp==5.1.1
anytree==2.8.0
asgiref==3.5.2
async-timeout==4.0.2
attrs==22.1.0
autobahn==22.7.1
Automat==22.10.0
beautifulsoup4==4.11.1
billiard==3.6.4.0
celery==5.2.7
certifi==2022.9.24
cffi==1.15.1
channels==4.0.0
channels-redis==4.0.0
charset-normalizer==2.1.1
click==8.1.3
click-didyoumean==0.3.0
click-plugins==1.1.1
click-repl==0.2.0
constantly==15.1.0
coreapi==2.3.3
coreschema==0.0.4
cryptography==38.0.3
daphne==4.0.0
Deprecated==1.2.13
Django==4.0.8
django-celery-beat==2.3.0
django-celery-results==2.4.0
django-filter==22.1
django-jalali==6.0.0
django-timezone-field==5.0
djangorestframework==3.14.0
djangorestframework-simplejwt==5.2.2
drf-yasg==1.21.4
et-xmlfile==1.1.0
gunicorn==20.1.0
h2==4.1.0
hpack==4.0.0
hyperframe==6.0.1
hyperlink==21.0.0
idna==3.4
incremental==22.10.0
inflection==0.5.1
itypes==1.2.0
jdatetime==4.1.0
Jinja2==3.1.2
kombu==5.2.4
lxml==4.9.1
MarkupSafe==2.1.1
msgpack==1.0.4
multitasking==0.0.11
numpy==1.23.3
openpyxl==3.0.10
packaging==21.3
pandas==1.5.0
pandas-datareader==0.10.0
Pillow==9.2.0
priority==1.3.0
prompt-toolkit==3.0.31
psutil==5.9.2
psycopg2==2.9.4
pyasn1==0.4.8
pyasn1-modules==0.2.8
pycparser==2.21
PyJWT==2.6.0
pyOpenSSL==22.1.0
pyparsing==3.0.9
python-crontab==2.6.0
python-dateutil==2.8.2
python-dotenv==0.21.0
pytz==2022.4
redis==4.3.4
requests==2.28.1
ruamel.yaml==0.17.21
ruamel.yaml.clib==0.2.7
service-identity==21.1.0
simplejson==3.17.6
six==1.16.0
soupsieve==2.3.2.post1
sqlparse==0.4.3
Twisted==22.10.0
txaio==22.2.1
typing_extensions==4.4.0
tzdata==2022.5
Unidecode==1.3.6
uritemplate==4.1.1
urllib3==1.26.12
vine==5.0.0
wcwidth==0.2.5
wrapt==1.14.1
yfinance==0.1.74
zope.interface==5.5.1
I did download packages with:
pip download -r requirements.txt
This is list of downloaded pacakges in ~/LocalPythonPackage directory:
→ ls
amqp-5.1.1-py3-none-any.whl lxml-4.9.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl
anytree-2.8.0-py2.py3-none-any.whl MarkupSafe-2.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
asgiref-3.5.2-py3-none-any.whl msgpack-1.0.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
async_timeout-4.0.2-py3-none-any.whl multitasking-0.0.11-py3-none-any.whl
attrs-22.1.0-py2.py3-none-any.whl numpy-1.23.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
autobahn-22.7.1.tar.gz openpyxl-3.0.10-py2.py3-none-any.whl
Automat-22.10.0-py2.py3-none-any.whl packaging-21.3-py3-none-any.whl
beautifulsoup4-4.11.1-py3-none-any.whl pandas-1.5.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
billiard-3.6.4.0-py3-none-any.whl pandas_datareader-0.10.0-py3-none-any.whl
celery-5.2.7-py3-none-any.whl Pillow-9.2.0-cp310-cp310-manylinux_2_28_x86_64.whl
certifi-2022.9.24-py3-none-any.whl priority-1.3.0-py2.py3-none-any.whl
cffi-1.15.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl prompt_toolkit-3.0.31-py3-none-any.whl
channels-4.0.0-py3-none-any.whl psutil-5.9.2-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
channels_redis-4.0.0-py3-none-any.whl psycopg2-2.9.4.tar.gz
charset_normalizer-2.1.1-py3-none-any.whl pyasn1-0.4.8-py2.py3-none-any.whl
click-8.1.3-py3-none-any.whl pyasn1_modules-0.2.8-py2.py3-none-any.whl
click_didyoumean-0.3.0-py3-none-any.whl pycparser-2.21-py2.py3-none-any.whl
click_plugins-1.1.1-py2.py3-none-any.whl PyJWT-2.6.0-py3-none-any.whl
click_repl-0.2.0-py3-none-any.whl pyOpenSSL-22.1.0-py3-none-any.whl
constantly-15.1.0-py2.py3-none-any.whl pyparsing-3.0.9-py3-none-any.whl
coreapi-2.3.3-py2.py3-none-any.whl python-crontab-2.6.0.tar.gz
coreschema-0.0.4.tar.gz python_dateutil-2.8.2-py2.py3-none-any.whl
cryptography-38.0.3-cp36-abi3-manylinux_2_28_x86_64.whl python_dotenv-0.21.0-py3-none-any.whl
daphne-4.0.0-py3-none-any.whl pytz-2022.4-py2.py3-none-any.whl
Deprecated-1.2.13-py2.py3-none-any.whl redis-4.3.4-py3-none-any.whl
Django-4.0.8-py3-none-any.whl requests-2.28.1-py3-none-any.whl
django_celery_beat-2.3.0-py3-none-any.whl ruamel.yaml-0.17.21-py3-none-any.whl
django_celery_results-2.4.0-py3-none-any.whl ruamel.yaml.clib-0.2.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl
django_filter-22.1-py3-none-any.whl service_identity-21.1.0-py2.py3-none-any.whl
django_jalali-6.0.0-py3-none-any.whl setuptools-65.6.3-py3-none-any.whl
djangorestframework-3.14.0-py3-none-any.whl simplejson-3.17.6-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
djangorestframework_simplejwt-5.2.2-py3-none-any.whl six-1.16.0-py2.py3-none-any.whl
django_timezone_field-5.0-py3-none-any.whl soupsieve-2.3.2.post1-py3-none-any.whl
drf_yasg-1.21.4-py3-none-any.whl sqlparse-0.4.3-py3-none-any.whl
et_xmlfile-1.1.0-py3-none-any.whl Twisted-22.10.0-py3-none-any.whl
gunicorn-20.1.0-py3-none-any.whl txaio-22.2.1-py2.py3-none-any.whl
h2-4.1.0-py3-none-any.whl typing_extensions-4.4.0-py3-none-any.whl
hpack-4.0.0-py3-none-any.whl tzdata-2022.5-py2.py3-none-any.whl
hyperframe-6.0.1-py3-none-any.whl Unidecode-1.3.6-py3-none-any.whl
hyperlink-21.0.0-py2.py3-none-any.whl uritemplate-4.1.1-py2.py3-none-any.whl
idna-3.4-py3-none-any.whl urllib3-1.26.12-py2.py3-none-any.whl
incremental-22.10.0-py2.py3-none-any.whl vine-5.0.0-py2.py3-none-any.whl
inflection-0.5.1-py2.py3-none-any.whl wcwidth-0.2.5-py2.py3-none-any.whl
itypes-1.2.0-py2.py3-none-any.whl wrapt-1.14.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
jdatetime-4.1.0-py3-none-any.whl yfinance-0.1.74-py2.py3-none-any.whl
Jinja2-3.1.2-py3-none-any.whl zope.interface-5.5.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
and after copy all `.whl files to traget computer, I did run this code:
pip install --no-index --find-links ~/LocalPythonPackage -r requirements.txt
But I got this error:
ERROR: Could not find a version that satisfies the requirement MarkupSafe==2.1.1 (from versions: none)
ERROR: No matching distribution found for MarkupSafe==2.1.1
I use python3.11 and Ubuntu 20.04.5 LTS in both computers. I think that, this problem is for dependencies or different in OS.
Can you help me to solve this problem?
TL;DR
You need to use --platform and --only-binary=:all: (sometimes need to specify --abi and --python-version as well) flags to download wheels that is compatible with your installation target machine.
pip3 download --only-binary=:all: --platform manylinux2014_aarch64 -r requirements.txt
(Important: if your target machine is not aarch64 architecture, replace the manylinux2014_aarch64 with the correct platform tag)
Some wheels are platform dependent
The error happens because pip can't install the MarkupSafe wheel you provided in the directory, therefore it says it can't find a valid distribution.
Since you mentioned the two computers are same in Python version and OS distribution, I'm gonna guess that the two computers you use are different in architectures. (ex. the target computer is aarch64)
The following explanation and solution are based on this guess.
The Python Packaging User Guide states a Python wheel could be either a "pure Python wheel" or a "platform wheel". When a Python package contains extensions that requires compilation, the produced wheel will be platform-specific and cannot be installed on other non-compatible platforms.
In your case, the wheel MarkupSafe-2.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl is a platform wheel built for Python 3.10 runtime, manylinux2014 and x86_64 architecture machines.
The wheel filename is defined in PEP 491, formatted as {distribution}-{version}(-{build tag})?-{python tag}-{abi tag}-{platform tag}.whl.
The last three components of the filename before the extension are called “compatibility tags.” The compatibility tags express the package’s basic interpreter requirements and are detailed in PEP 425.
Hence by the name of a wheel (to be precise, the last three component in the filename) you can find out if it is a pure Python wheel or a platform wheel.
Newer Python versions (except different major versions) can still install platform wheels built for older minor versions
Another answer in the post says you need to install a wheel that has the same miner Python version in the Python tag, but that is usually not true.
According to PEP 425:
The tags are used by installers to decide which built distribution (if any) to download from a list of potential built distributions. The installer maintains a list of (pyver, abi, arch) tuples that it will support. If the built distribution’s tag is in the list, then it can be installed.
That means pip is responsible for make decision whether a distribution could be installed on the current system.
Let's take a look at the source code of pip. The CandidateEvaluator evaluate possible distribution candidates when trying to install a package.
If you trace the code all the way to _py_interpreter_range, you'll find out a list of older Python minor versions are appended to the supported tags in descending order.
For Python 3.11, Python 3.10, Python 3.9, Python 3.8... are all considered supported tags for pip.
Solution
pip download with the --platform, --python-version, --implementation, and --abi options provides the ability to fetch dependencies for an interpreter and system other than the ones that pip is running on. --only-binary=:all: or --no-deps is required when using any of these options.
from https://pip.pypa.io/en/stable/cli/pip_download/.
To download MarkupSafe for manylinux2014_aarch64:
$ pip3 download --only-binary=:all: --platform manylinux2014_aarch64 MarkupSafe
And change your package preparation command to:
pip3 download --only-binary=:all: --platform manylinux2014_aarch64 -r requirements.txt
You use Python 3.11 but wheels you show above are for Python 3.10. You should download packages on a host with the same processor architecture (x64 seems to be your case), the same OS and version (Ubuntu 20) and the same minor Python version (Python 3.11.*, that is any Python 3.11 does but not Python 3.10) as the target host.
Or use Python 3.10 on the offline host.
I was trying to test the pip install -e . on my library ultimate-utils after changing laptops but I keep getting errors of this type:
(uutils_env) brandomiranda~/ultimate-utils ❯ pip install -e .
Obtaining file:///Users/brandomiranda/ultimate-utils
Preparing metadata (setup.py) ... done
ERROR: Could not find a version that satisfies the requirement torchvision==0.10.1 (from ultimate-utils) (from versions: 0.1.6, 0.1.7, 0.1.8, 0.1.9, 0.2.0, 0.2.1, 0.2.2, 0.2.2.post2, 0.2.2.post3)
ERROR: No matching distribution found for torchvision==0.10.1
or
(uutils_env) brandomiranda~/ultimate-utils ❯ pip install -e .
Obtaining file:///Users/brandomiranda/ultimate-utils
Preparing metadata (setup.py) ... done
ERROR: Could not find a version that satisfies the requirement torch==1.9.1 (from ultimate-utils) (from versions: none)
ERROR: No matching distribution found for torch==1.9.1
where it seems it stopped working to install anything related to pytorch for some reason.
I tried updating pip and conda but it did not work. I did:
pip install --upgrade pip
conda update conda
conda update conda-build
conda update -n base -c defaults conda
conda update --name base conda
conda update --all
conda install anaconda
but none seem to work.
my setup.py looks as follows:
"""
conda create -n uutils_env python=3.9
conda activate uutils_env
conda remove --all --name uutils_env
rm -rf /Users/brando/anaconda3/envs/uutils_env
pip install -e ~/ultimate-utils/ultimate-utils-proj-src/
pip install ultimate-utils
To test it:
python -c "import uutils; uutils.hello()"
python -c "import uutils; uutils.torch_uu.hello()"
python -c "import uutils; uutils.torch_uu.gpu_test_torch_any_device()"
python -c "import uutils; uutils.torch_uu.gpu_test()"
PyTorch:
basing the torch install from the pytorch website as of this writing: https://pytorch.org/get-started/locally/
pip3 install torch==1.9.1+cu111 torchvision==0.10.1+cu111 torchaudio==0.9.1 -f https://download.pytorch.org/whl/torch_stable.html
refs:
- setup tools: https://setuptools.pypa.io/en/latest/userguide/package_discovery.html#using-find-or-find-packages
"""
from setuptools import setup
from setuptools import find_packages
import os
# import pathlib
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='ultimate-utils', # project name
version='0.5.3',
description="Brando's ultimate utils for science, machine learning and AI",
long_description=long_description,
long_description_content_type="text/markdown",
url='https://github.com/brando90/ultimate-utils',
author='Brando Miranda',
author_email='brandojazz#gmail.com',
python_requires='>=3.9.0',
license='MIT',
package_dir={'': 'ultimate-utils-proj-src'},
packages=find_packages('ultimate-utils-proj-src'), # imports all modules/folders with __init__.py & python files
# for pytorch see doc string at the top of file
install_requires=[
# 'torch==1.9.1',
'torchvision==0.10.1',
'torchaudio==0.9.1',
'dill',
'networkx>=2.5',
'scipy',
'scikit-learn',
'lark-parser',
'torchtext==0.10.1',
'tensorboard',
'pandas',
'progressbar2',
'transformers',
'requests',
'aiohttp',
'numpy',
'plotly',
'wandb',
'matplotlib',
# 'seaborn'
# 'pygraphviz' # removing because it requires user to install graphviz and gives other issues
]
)
the dir structure is simple:
How do I fix this and what is not working?
I am trying to avoid having to run pip commands outside like:
conda install pytorch torchvision torchaudio -c pytorch
at least for cpu in my local laptop...if I can install gpu ones automatically with a flag it could be nice but for future work...
Btw, I prefer no requirements.txt solutions if possible, but post those too in case nothing else works.
This is for an intel mac 2013, but I will have an m1 max in 2 months, so those answers are also welcomed!
still fails:
(uutils_env) brandomiranda~/ultimate-utils ❯ pip install -e .
Obtaining file:///Users/brandomiranda/ultimate-utils
Preparing metadata (setup.py) ... done
ERROR: Could not find a version that satisfies the requirement torch<1.10.0,>=1.4.0 (from ultimate-utils) (from versions: none)
ERROR: No matching distribution found for torch<1.10.0,>=1.4.0
Related resources I tried:
https://docs.conda.io/projects/conda-build/en/latest/install-conda-build.html
PackageNotInstalledError: Package is not installed in prefix
Installing PyTorch with CUDA in setup.py
https://github.com/brando90/ultimate-utils
https://pytorch.org/get-started/locally/
https://discuss.pytorch.org/t/how-does-one-install-pytorch-and-related-tools-from-within-the-setup-py-install-requires-list/138976
How does one install PyTorch and related tools from within the setup.py install_requires list?
https://www.reddit.com/r/pytorch/comments/rcprlk/how_does_one_install_pytorch_and_related_tools/
Could not find a version that satisfies the requirement torch>=1.0.0?
See this Why is python using 3.8.1 and 3.9, then fail to install packages (ERROR: Package pkg requires a different Python: 3.8.1 not in '>=3.9.0')? for a more complete answer but the summary is that pytorch seems to not be working right now reliable with python 3.10 so I created an env with 3.9 and then it installed what I needed.
I am trying to follow tutorial at http://conda.pydata.org/docs/build_tutorials/pkgs.html to create conda skeleton from pypi pyinstrument package.
when I call command conda skeleton pypi pyinstrument, it throws following error:
C:\WINDOWS\system32>conda skeleton pypi pyinstrument
Warning, the following versions were found for pyinstrument
0.10.1
0.11
0.12
0.13
0.13.1
Using 0.13.1
Use --version to specify a different version.
Using url https://pypi.python.org/packages/64/56/d7a0d48973dcf58ea74d5f004e16e9496
Downloading pyinstrument
Using cached download
Unpacking pyinstrument...
done
working in C:\Users\Peter\AppData\Local\Temp\tmpi40k4yslconda_skeleton_pyinstrumen
The following NEW packages will be INSTALLED:
pip: 8.1.2-py35_0
python: 3.5.2-0
pyyaml: 3.12-py35_0
setuptools: 27.2.0-py35_1
vs2015_runtime: 14.0.25123-0
wheel: 0.29.0-py35_0
Applying patch: 'C:\\Users\\Peter\\AppData\\Local\\Temp\\tmpi40k4yslconda_skeleton
Error:
Cannot use 'git' (not a git repo and/or patch) and did notfind 'patch' in: C:\Users\Peter\Anaconda3\conda-bld\skeleton_1478133848196\_b_env\Scripts;.....
...You can install 'patch' using apt-get, yum (Linux), Xcode (MacOSX),
or conda, m2-patch (Windows),
This error is also thrown when trying to install py-stackexchange package, what am I doing wrong?
As comment suggested, install patch or m2-patch.
In my case, I installed m2-patch and it fixed the issue for me.
So I am trying to install ipywidgets-0.0.1 into my Anaconda environment. I am running Anaconda3. Unfortunately, the machine I need to install it on does not have internet access.
The basic way to install the package is to run conda install ipywidgets, but of course this gives the following error:
Fetching package metadata: Could not connect to https://repo.continuum.io/pkgs/p
ro/noarch/
Could not connect to https://repo.continuum.io/pkgs/free/win-64/
Could not connect to https://repo.continuum.io/pkgs/pro/win-64/
.Could not connect to https://repo.continuum.io/pkgs/free/noarch/
...
Solving package specifications: .
Package plan for installation in environment C:\Program Files\Anaconda3:
The following packages will be downloaded:
package | build
---------------------------|-----------------
ipywidgets-0.0.1 | np19py34_0 7 KB
The following NEW packages will be INSTALLED:
ipywidgets: 0.0.1-np19py34_0
Proceed ([y]/n)? y
Fetching packages ...
Could not connect to https://repo.continuum.io/pkgs/free/win-64/ipywidgets-0.0.1
-np19py34_0.tar.bz2
Error: Connection error: HTTPSConnectionPool(host='repo.continuum.io', port=443)
: Max retries exceeded with url: /pkgs/free/win-64/ipywidgets-0.0.1-np19py34_0.t
ar.bz2 (Caused by ProtocolError('Connection aborted.', gaierror(11004, 'getaddri
nfo failed'))):
https://repo.continuum.io/pkgs/free/win-64/ipywidgets-0.0.1-np19py34_0.tar.bz2
This makes sense, since the box can't access the internet.
I downloaded the ipywidgets tarball from the listed URL at https://repo.continuum.io/pkgs/free/win-64/ipywidgets-0.0.1-np19py34_0.tar.bz2, and I ssh'ed it onto the box.
What command can I run on the box (it is a Windows 7 environment) so that it will run the install as local, looking at the downloaded tarball to unpack rather than trying to access the internet to get the file?
Download the whole package and its dependencies to some local directory
You can get it from PYPI ipywidgets
Let's consider you donwloaded from PYPI and you have ~/src/ipywidgets with ~/src/ipywidgets/setup.py which will have install_requires with a list of dep. in your /pypi directory. Like so:
install_requires=['hello', 'etc', ...]
To install your app and its dep. into the current python env., you've to do something like:
$ cd ~/src/ipywidgets
$ easy_install --always-unzip --allow-hosts=None --find-links=/pypi
Note that the build will fail if one or more dependencies are missing
If you want to use conda for this, might as well if you are already using anaconda, you should also be able to do:
conda install --offline PATH_TO_FILE/ipywidgets-0.0.1-np19py34_0.tar.bz2
Where, of course, PATH_TO_FILE is just the path to the file you've downloaded.
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.