Python's “easy_install” on Windows - HtmlCSSInclude - python

I just installed Python 2.7 and easy_install-2.7.exe on my Windows 2003 server, then set %PATH% to C:\Python27;C:\Python27\Scripts;. Then I tried to install a python package with easy_install, but easy_install failed. The failure follows:
C:\>easy_install HtmlCssInclude
Searching for HtmlCssInclude
Reading http://pypi.python.org/simple/HtmlCssInclude/
Best match: HtmlCssInclude 0.1.2
Downloading http://pypi.python.org/packages/source/H/HtmlCssInclude/HtmlCssInclu
de-0.1.2.tar.gz#md5=0b4438bf62ae66842a514dcff67c0cd7
Processing HtmlCssInclude-0.1.2.tar.gz
Running HtmlCssInclude-0.1.2\setup.py -q bdist_egg --dist-dir c:\docume~1\admini
~1\locals~1\temp\1\easy_install-qpossf\HtmlCssInclude-0.1.2\egg-dist-tmp-haku7q
C:\Python27\Lib\distutils\dist.py:267: UserWarning: Unknown distribution option:
'auther'
warnings.warn(msg)
warning: no files found matching 'testdata'
error: Setup script exited with error: can't copy 'sample.css': doesn't exist or
not a regular file
Anybody please help me.

I tried editing this package and it installed.
Downloaded the package and edited HtmlCssinclude.py. In addition i found the reference to 'sample.css' and 'testdata' is not necessary for this package installation. So i also removed those reference. This help me to install package from local folder.

Related

python installing thread-local storage

I'm trying to install a pysnap library from github. This is part of the output I get. I have no idea how to proceed, any help would be greatly appreciated.
Installed /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pysnap-0.1.1-py2.7.egg
Processing dependencies for pysnap==0.1.1
Searching for cryptography>=1.2.2
Reading https://pypi.python.org/simple/cryptography/
Best match: cryptography 1.2.3
Downloading https://pypi.python.org/packages/source/c/cryptography/cryptography-1.2.3.tar.gz#md5=5474d2b3e8c7555a60852e48d2743f85
Processing cryptography-1.2.3.tar.gz
Writing /tmp/easy_install-7ZnmT5/cryptography-1.2.3/setup.cfg
Running cryptography-1.2.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-7ZnmT5/cryptography-1.2.3/egg-dist-tmp-rcoXcx
_configtest.c:1:1: error: thread-local storage is unsupported for the current target
__thread int some_threadlocal_variable_42;
1 error generated.
error: unable to create target: 'No available targets are compatible with this triple, see -version for the
available targets.'
1 error generated.
What platform are you trying to install pysnap?
I downloaded and installed pysnap sucessfully from this github location
I do have windows 10 platform and python 2.7 though. I dont' have a linux to replicate this issue.
If you are trying to install on Linux, depending on flavor and its setup , sometimes swap is setup as as /tmp and some applications are not able to write to /tmp. In your case it does looks like its trying to write to /tmp and erroring out.
Can you try pip install cryptography
and see if its able to install cryptography part without issues?
Once that dependency is out of way, you can install pysnap so that pysnap will not try to install cryptography

Error installing Willie irc bot for Python

Trying to install this Python IRC bot called Willie. This is what happens when I run setup.py:
C:\Python34\python.exe "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 4.5.1\helpers\pycharm\pycharm_setup_runner.py" C:\Users\Quibbles\Documents\willie-5.3.0\setup.py
Testing started at 1:35 PM ...
running pycharm_test
Searching for pygeoip
Best match: pygeoip 0.3.2
Processing pygeoip-0.3.2-py3.4.egg
Using c:\users\quibbles\documents\willie-5.3.0\.eggs\pygeoip-0.3.2-py3.4.egg
Searching for pyenchant
Best match: pyenchant 1.6.6
Processing pyenchant-1.6.6-py3.4-win32.egg
Using c:\users\quibbles\documents\willie-5.3.0\.eggs\pyenchant-1.6.6-py3.4-win32.egg
Searching for praw
Best match: praw 2.1.21
Processing praw-2.1.21-py3.4.egg
Using c:\users\quibbles\documents\willie-5.3.0\.eggs\praw-2.1.21-py3.4.egg
Searching for lxml
Reading https://pypi.python.org/simple/lxml/
Best match: lxml 3.4.4
Downloading https://pypi.python.org/packages/source/l/lxml/lxml-3.4.4.tar.gz#md5=a9a65972afc173ec7a39c585f4eea69c
Processing lxml-3.4.4.tar.gz
Writing C:\Users\Quibbles\AppData\Local\Temp\easy_install-p_x9naya\lxml-3.4.4\setup.cfg
Running lxml-3.4.4\setup.py -q bdist_egg --dist-dir C:\Users\Quibbles\AppData\Local\Temp\easy_install-p_x9naya\lxml-3.4.4\egg-dist-tmp-0expfysa
Building lxml version 3.4.4.
Building without Cython.
ERROR: b"'xslt-config' is not recognized as an internal or external command,\r\noperable program or batch file.\r\n"
** make sure the development packages of libxml2 and libxslt are installed **
Using build configuration of libxslt
C:\Python34\lib\distutils\dist.py:260: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
cl : Command line warning D9025 : overriding '/W3' with '/w'
lxml.etree.c
C:\Users\Quibbles\AppData\Local\Temp\easy_install-p_x9naya\lxml-3.4.4\src\lxml\includes\etree_defs.h(14) : fatal error C1083: Cannot open include file: 'libxml/xmlversion.h': No such file or directory
error: Setup script exited with error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\BIN\\cl.exe' failed with exit status 2
Process finished with exit code 1
What am I doing wrong? I downloaded the source code from https://github.com/embolalia/willie/releases/tag/v5.3.0 and tried running setup.py in PyCharm.
It should be fairly obvious by the error messages:
** make sure the development packages of libxml2 and libxslt are installed **
You need to have the dev libxml2 and libxslt installed. It appears either you have the wrong versions perhaps, or don't have them installed properly.
I'L'I's answer gives you a hint of where to start searching next, but isn't a useful answer.
After several attempts on my own, I found that to get the lxml library installed, I needed to do the following:
First, download the lxml library from http://www.lfd.uci.edu/~gohlke/pythonlibs/
This is necessary because the PiPy archives (https://pypi.python.org/pypi/lxml/3.4.4) are way out of date, only giving you the option to install for Python 3.2 for the 3+ series, which of course is useless if you're on 3.4. There's also issues if you're using 64-bit. They may be sufficient if you're using 2.7, though.
Then use the instructions here: How do I install a Python package with a .whl file? to install the .whl file.
However that only fixes half the problem. The willie package appears to be broken in other ways (on Windows) because of trying to reference a unix-like /tmp directory (absolute path) instead of the proper Windows Temp directory.
This issue describes the problem, though no fix has yet been made: https://github.com/embolalia/willie/issues/811
It indicates that it's a Windows-specific bug in the installer. To work around that, download the .tar.gz from https://pypi.python.org/pypi/willie/5.3.0
Unpack it. Go to the willie-5.3.0\willie.egg-info directory, and edit the SOURCES.txt file. The fifth line is /tmp/tmpeAhjCF/willie. Delete that line.
Repackage the directory into a .tar.gz archive. Install via pip install .\willie-5.3.0.tar.gz.
Now it's installed, and you're ready for the next round of problems of actually getting it to run on Windows. Since I haven't actually succeeded in doing that yet, that's as far as I can help for right now.

setuptools finds wrong package during install

In myria-python, we use setuptools with install_requires to configure which packages are needed. In our particular setup file, we include requests-toolbelt and requests in that list.
When we create a new virtual environment and then run python setup.py install, it fails the first time with Cannot find required distribution requests. This happens seemingly because pip identifies requests toolbelt-0.3.1 (note the space) as the right match for package requests.
Running python setup.py install again seems to install requests after all.
Here is a GitHub issue with a full log of the install process.
Steps to reproduce:
git clone https://github.com/uwescience/myria-python.git
cd myria-python
mkvirtualenv myria-python
python setup.py
The entire lab seems to have this issue, however all of us use Mac OS X with either 10.9 or 10.10 installed. Here are my machine's specs:
OS X 10.10.1
Python 2.7.9 (default, Dec 10 2014, 23:46:04)
pip 1.5.6
mkvirtualenv 1.11.6
I was also able to duplicate it on one of our Ubuntu servers:
Ubuntu 14.04.1 LTS \n \l
Python 2.7.6
pip 1.5.4
mkvirtualenv 1.11.4
Here is the tail of the error log:
Searching for requests-toolbelt
Reading https://pypi.python.org/simple/requests_toolbelt/
Best match: requests-toolbelt 0.3.1
Downloading https://pypi.python.org/packages/source/r/requests-toolbelt/requests-toolbelt-0.3.1.tar.gz#md5=e563377e46cd0be8c7b3ac144a65844c
Processing requests-toolbelt-0.3.1.tar.gz
Writing /var/folders/m_/qltd_g_13qd1v5tvr4l6q2rc0000gn/T/easy_install-2lqn7g/requests-toolbelt-0.3.1/setup.cfg
Running requests-toolbelt-0.3.1/setup.py -q bdist_egg --dist-dir /var/folders/m_/qltd_g_13qd1v5tvr4l6q2rc0000gn/T/easy_install-2lqn7g/requests-toolbelt-0.3.1/egg-dist-tmp-riz25e
no previously-included directories found matching '*.pyc'
warning: manifest_maker: MANIFEST.in, line 6: 'recursive-include' expects <dir> <pattern1> <pattern2> ...
warning: manifest_maker: MANIFEST.in, line 7: 'recursive-include' expects <dir> <pattern1> <pattern2> ...
no previously-included directories found matching 'docs/_build'
zip_safe flag not set; analyzing archive contents...
Adding requests-toolbelt 0.3.1 to easy-install.pth file
Installed /Users/dhalperi/Envs/myria-python2/lib/python2.7/site-packages/requests_toolbelt-0.3.1-py2.7.egg
Searching for requests
Best match: requests toolbelt-0.3.1
Downloading https://pypi.python.org/packages/source/r/requests-toolbelt/requests-toolbelt-0.3.1.tar.gz#md5=e563377e46cd0be8c7b3ac144a65844c
Processing requests-toolbelt-0.3.1.tar.gz
Writing /var/folders/m_/qltd_g_13qd1v5tvr4l6q2rc0000gn/T/easy_install-LKxX9E/requests-toolbelt-0.3.1/setup.cfg
Running requests-toolbelt-0.3.1/setup.py -q bdist_egg --dist-dir /var/folders/m_/qltd_g_13qd1v5tvr4l6q2rc0000gn/T/easy_install-LKxX9E/requests-toolbelt-0.3.1/egg-dist-tmp-3tgz5e
no previously-included directories found matching '*.pyc'
warning: manifest_maker: MANIFEST.in, line 6: 'recursive-include' expects <dir> <pattern1> <pattern2> ...
warning: manifest_maker: MANIFEST.in, line 7: 'recursive-include' expects <dir> <pattern1> <pattern2> ...
no previously-included directories found matching 'docs/_build'
zip_safe flag not set; analyzing archive contents...
requests-toolbelt 0.3.1 is already the active version in easy-install.pth
Installed /Users/dhalperi/Envs/myria-python2/lib/python2.7/site-packages/requests_toolbelt-0.3.1-py2.7.egg
error: Could not find required distribution requests
How can I fix this so that the package installs without running setup.py twice?
(Mirrored from https://github.com/uwescience/myria-python/pull/35)
Multiple hours of 100's of Google searches eventually took me to this
numpy thread:
https://github.com/numpy/numpy/issues/2434
for which they had to add numpy to setup_requires AND install_requires to fix a similar issue. Doing
this with requests seems to have worked. However, I am somewhat
skeptical as #Timusan indicated above not seeing our problem in the
first place.
I tried on my Mac as well as on Ubuntu, and am now able to
install from a clean virtualenv on both systems.
As others have mentioned in the comments, the root cause is a buggy version of python / pip. This problem exists with python 2.7.6, but when I upgraded to 2.7.9 there was no longer a problem. Also beware that mkirtualenv by default uses the python in /usr/bin/python, even if there are other python versions further up in the $PATH.

PIP install "error: package directory 'X' does not exist"

I am trying to install this package via PIP. It gives me the following error:
error: package directory 'RTbatch' does not exist
I find this weird, because the relevant setup.py does not mention any packages variable, but only py_modules.
What's wrong? Can you help me out?
Here is the full output of pip install -e RTbatch:
Obtaining file:///home/chymera/RTbatch
Running setup.py (path:/home/chymera/RTbatch/setup.py) egg_info for package from file:///home/chymera/RTbatch
/usr/lib64/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'heywords'
warnings.warn(msg)
error: package directory 'RTbatch' does not exist
Complete output from command python setup.py egg_info:
/usr/lib64/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'heywords'
warnings.warn(msg)
running egg_info
creating RTbatch.egg-info
writing requirements to RTbatch.egg-info/requires.txt
writing RTbatch.egg-info/PKG-INFO
writing top-level names to RTbatch.egg-info/top_level.txt
writing dependency_links to RTbatch.egg-info/dependency_links.txt
writing manifest file 'RTbatch.egg-info/SOURCES.txt'
warning: manifest_maker: standard file '-c' not found
error: package directory 'RTbatch' does not exist
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /home/chymera/RTbatch
Storing debug log for failure in /home/chymera/.pip/pip.log
py_modules takes a list of module names, not files. Your call looks for RTBatch/py.py and RTBatch_cli/py.py.
In my case, it was about that the folder which I use for installation was corrupted. It was not installed completely. I downloaded it on my laptop and then moved it to the server. But it was broken. so I download it again and everything goes well.
In my case, I was on Windows and the current directory was in a different drive, python <full path including drive>/setup.py install fails, had to change to the drive and folder and use python setup.py instead.
It seems you have added project folder (RTbatch) as a package in setup.py. Just make sure to have packages list in setup.py contains only python packages (ex: folders with init.py).
Hope this fix the issue.

I'm looking for gevent for Python 2.7 for windows

However gevent depends upon greenlet and the .msi version I found fails to install and the egg for 2.6 refuses to install.
The msi version fails as follows.
C:\Windows\system32>easy_install greenlet
install_dir C:\Python27\Lib\site-packages\
Searching for greenlet
Reading http://pypi.python.org/simple/greenlet/
Reading http://bitbucket.org/ambroff/greenlet
Reading http://undefined.org/python/#greenlet
Best match: greenlet 0.3.1
Downloading http://pypi.python.org/packages/source/g/greenlet/greenlet-0.3.1.tar.gz#md5=8d75d7f3f659e915e286e1b0fa0e1c4d
Processing greenlet-0.3.1.tar.gz
Running greenlet-0.3.1\setup.py -q bdist_egg --dist-dir c:\users\ian\appdata\local\temp\easy_install-1epg28\greenlet-0.3.1\egg-dist-tmp-mqhu3n
C:\Python27\lib\distutils\dist.py:267: UserWarning: Unknown distribution option: 'repository'
warnings.warn(msg)
greenlet.c
greenlet.c : fatal error C1074: 'IDB' is illegal extension for PDB file:
error: Setup script exited with error: command '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.exe"' failed with exit status 2
C:\Windows\system32>
I guess this means that I have a wrong version of VS.
Is there anything else I can use?
I want to get PyQt4 so the GUI won't lock up if the database can't be reached or takes ages to reply.
This worked for me:
Grab the gevent installer from the Unofficial Windows Binaries for Python Extension Packages
Install greenlet from that same site
And if you're on a 64-bit Windows 7 machine and are having trouble installing, read this too.
You should ask the maintainer of greenlet to build .msi for Python 2.7.
I did it here: greenlet issue #17
Update: There are now builds for Python 2.7 on PyPI: http://pypi.python.org/pypi/greenlet
I've got latest version from here - http://code.google.com/p/gevent/downloads/detail?name=gevent-1.0a3.win32-py2.7.msi
There is .exe too. Look for both installer and .exe here - http://code.google.com/p/gevent/updates/list

Categories

Resources