How to set up a Virtual Environment for makerbot/s3g - python

I'm trying to get this module working:
https://github.com/makerbot/s3g
Their naming is a bit confusing, as the whole thing often gets referred to as "makerbot_driver" and there is also a subfolder called that.
I run into to trouble when I try to run the command:
python virtualenv.py virtualenv
When I try to run it in the makerbot_driver folder, as they suggest, I get this:
python: can't open file 'virtualenv.py': [Errno 2] No such file or directory
Which makes sense, as virtualenv.py is actually one folder up. However, when I go one folder up, and run the same command, it has a bit more success, but runs into a bunch of errors that I really can't seem to interpret:
New python executable in virtualenv/bin/python
Installing setuptools...................................
Complete output from command /home/jason/GitHub/s3g/virtualenv/bin/python -c "#!python
\"\"\"Bootstra...sys.argv[1:])
" /home/jason/GitHub/s...ols-0.6c11-py2.7.egg:
Traceback (most recent call last):
File "<string>", line 279, in <module>
File "<string>", line 240, in main
File "/home/jason/GitHub/s3g/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 1712, in main
File "/home/jason/GitHub/s3g/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 1700, in with_ei_usage
File "/home/jason/GitHub/s3g/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 1716, in <lambda>
File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.7/distutils/dist.py", line 971, in run_command
cmd_obj.ensure_finalized()
File "/usr/lib/python2.7/distutils/cmd.py", line 109, in ensure_finalized
self.finalize_options()
File "/home/jason/GitHub/s3g/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 125, in finalize_options
File "/home/jason/GitHub/s3g/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 1121, in _expand
File "/usr/lib/python2.7/distutils/cmd.py", line 312, in get_finalized_command
cmd_obj.ensure_finalized()
File "/usr/lib/python2.7/distutils/cmd.py", line 109, in ensure_finalized
self.finalize_options()
File "/home/jason/GitHub/s3g/setuptools-0.6c11-py2.7.egg/setuptools/command/install.py", line 32, in finalize_options
File "/usr/lib/python2.7/distutils/command/install.py", line 321, in finalize_options
(prefix, exec_prefix) = get_config_vars('prefix', 'exec_prefix')
File "/home/jason/GitHub/s3g/virtualenv/lib/python2.7/distutils/__init__.py", line 88, in sysconfig_get_config_vars
real_vars = old_get_config_vars(*args)
File "/usr/lib/python2.7/distutils/sysconfig.py", line 495, in get_config_vars
func()
File "/usr/lib/python2.7/distutils/sysconfig.py", line 439, in _init_posix
from _sysconfigdata import build_time_vars
File "/usr/lib/python2.7/_sysconfigdata.py", line 6, in <module>
from _sysconfigdata_nd import *
ImportError: No module named _sysconfigdata_nd
----------------------------------------
...Installing setuptools...done.
Traceback (most recent call last):
File "virtualenv.py", line 2270, in <module>
main()
File "virtualenv.py", line 928, in main
never_download=options.never_download)
File "virtualenv.py", line 1040, in create_environment
search_dirs=search_dirs, never_download=never_download)
File "virtualenv.py", line 593, in install_setuptools
search_dirs=search_dirs, never_download=never_download)
File "virtualenv.py", line 567, in _install_req
cwd=cwd)
File "virtualenv.py", line 1006, in call_subprocess
% (cmd_desc, proc.returncode))
OSError: Command /home/jason/GitHub/s3g/virtualenv/bin/python -c "#!python
\"\"\"Bootstra...sys.argv[1:])
" /home/jason/GitHub/s...ols-0.6c11-py2.7.egg failed with error code 1
I've tried to install things like the pyserial module they require and virtualenv, and that's all turned out fine, but this virtualenv thing just keeps going badly for me.
Any advice at all would be appreciated. Thanks.

That is a known bug in Ubuntu. Fix:
$ cd /usr/lib/python2.7
$ sudo ln -s plat-x86_64-linux-gnu/_sysconfigdata_nd.py .
Then it works.
$ python2.7 virtualenv.py virtualenv
New python executable in virtualenv/bin/python2.7
Not overwriting existing python script virtualenv/bin/python (you must use virtualenv/bin/python2.7)
Installing setuptools................................done.
Installing pip.....................done.

Related

Can not import osgeo and GDAL libraries

I need the osgeo and GDAL libraries in python code. So, I imported them and I compiled to check whether they are installed or not (I'm not a python expert), and as expected the libraries do not exist. So, I tried to install it using the pycharm setting tools.
For the osgeo, I found two possibilities.
Django-osgeo-importer.
Django-osgeo-importer-client.
and the installation was successful. But for the GDAL I've got an error (see figure).
And I tried also to install the GDAL from the terminal and also I got this error:
anoir#anoir-Lenovo-IdeaPad-Y510P:~$ sudo -H pip install GDAL
Collecting GDAL
Using cached GDAL-2.2.1.tar.gz
Complete output from command python setup.py egg_info:
running egg_info
creating pip-egg-info/GDAL.egg-info
writing pip-egg-info/GDAL.egg-info/PKG-INFO
writing top-level names to pip-egg-info/GDAL.egg-info/top_level.txt
writing dependency_links to pip-egg-info/GDAL.egg-info/dependency_links.txt
writing manifest file 'pip-egg-info/GDAL.egg-info/SOURCES.txt'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-5IPiZv/GDAL/setup.py", line 339, in <module>
**extra )
File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/usr/local/lib/python2.7/dist-packages/setuptools/command/egg_info.py", line 280, in run
self.find_sources()
File "/usr/local/lib/python2.7/dist-packages/setuptools/command/egg_info.py", line 295, in find_sources
mm.run()
File "/usr/local/lib/python2.7/dist-packages/setuptools/command/egg_info.py", line 526, in run
self.add_defaults()
File "/usr/local/lib/python2.7/dist-packages/setuptools/command/egg_info.py", line 562, in add_defaults
sdist.add_defaults(self)
File "/usr/local/lib/python2.7/dist-packages/setuptools/command/py36compat.py", line 36, in add_defaults
self._add_defaults_ext()
File "/usr/local/lib/python2.7/dist-packages/setuptools/command/py36compat.py", line 119, in _add_defaults_ext
build_ext = self.get_finalized_command('build_ext')
File "/usr/lib/python2.7/distutils/cmd.py", line 312, in get_finalized_command
cmd_obj.ensure_finalized()
File "/usr/lib/python2.7/distutils/cmd.py", line 109, in ensure_finalized
self.finalize_options()
File "/tmp/pip-build-5IPiZv/GDAL/setup.py", line 214, in finalize_options
self.gdaldir = self.get_gdal_config('prefix')
File "/tmp/pip-build-5IPiZv/GDAL/setup.py", line 188, in get_gdal_config
return fetch_config(option)
File "/tmp/pip-build-5IPiZv/GDAL/setup.py", line 141, in fetch_config
raise gdal_config_error, e""")
File "<string>", line 4, in <module>
__main__.gdal_config_error: [Errno 2] No such file or directory
----------------------------------------
Command "python setup.by egg_info" failed with error code 1 in /tmp/pip-build-5IPiZv/GDAL/
So I tried to follow this tutorial Installing GDAL/OGR on Ubuntu and it worked but when I compile the scripts the same problem persists.
Any ideas please?

Problems importing magic on Windows 64-bit

I have searched on the internet for a solution to import magic correctly in Windows 10 64-bit. I found this, but I do not understand the solution.
It says to copy two DLLs into the specified path in the OS.
What does the below command mean?
file_magic = magic.Magic(magic_file="c:\path\to\magic.mgc")
Is the solution the combination of 1 + 2? Or just 1? I have done 1. Still getting an error. (the 1st error is solved)
>>> import magic
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\site-packages\magic.py", line 176, in <modu
raise ImportError('failed to find libmagic. Check your install
ImportError: failed to find libmagic. Check your installation
Second Error I am getting
>>> import magic
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\site-packages\magic\__init__.py", line 1, in <module>
from . import ffi
File "C:\Python27\lib\site-packages\magic\ffi.py", line 27, in <module>
ext_package="magic")
File "C:\Python27\lib\site-packages\cffi\api.py", line 437, in verify
lib = self.verifier.load_library()
File "C:\Python27\lib\site-packages\cffi\verifier.py", line 113, in load_library
self._compile_module()
File "C:\Python27\lib\site-packages\cffi\verifier.py", line 210, in _compile_module
outputfilename = ffiplatform.compile(tmpdir, self.get_extension())
File "C:\Python27\lib\site-packages\cffi\ffiplatform.py", line 29, in compile
outputfilename = _build(tmpdir, ext, compiler_verbose)
File "C:\Python27\lib\site-packages\cffi\ffiplatform.py", line 55, in _build
dist.run_command('build_ext')
File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "C:\Python27\lib\site-packages\setuptools\command\build_ext.py", line 75, in run
_build_ext.run(self)
File "C:\Python27\lib\distutils\command\build_ext.py", line 340, in run
self.build_extensions()
File "C:\Python27\lib\distutils\command\build_ext.py", line 449, in build_extensions
self.build_extension(ext)
File "C:\Python27\lib\site-packages\setuptools\command\build_ext.py", line 196, in build_extension
_build_ext.build_extension(self, ext)
File "C:\Python27\lib\distutils\command\build_ext.py", line 499, in build_extension
depends=ext.depends)
File "C:\Python27\lib\distutils\msvc9compiler.py", line 473, in compile
self.initialize()
File "C:\Python27\lib\distutils\msvc9compiler.py", line 383, in initialize
vc_env = query_vcvarsall(VERSION, plat_spec)
File "C:\Python27\lib\site-packages\setuptools\msvc.py", line 136, in msvc9_query_vcvarsall
return EnvironmentInfo(arch, ver).return_env()
File "C:\Python27\lib\site-packages\setuptools\msvc.py", line 1097, in return_env
[self.VCIncludes,
File "C:\Python27\lib\site-packages\setuptools\msvc.py", line 805, in VCIncludes
return [os.path.join(self.si.VCInstallDir, 'Include'),
File "C:\Python27\lib\site-packages\setuptools\msvc.py", line 542, in VCInstallDir
raise distutils.errors.DistutilsPlatformError(msg)
distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 9.0 is required. Get it from http://aka.ms/vcpython27
I think you are successfully completed Step 1. In 2nd step keep your magic.mgc file ( obtained by cloning of libmagicwin64) somewhere accessible by python script ( in the below case C:\Programs\libmagicwin64\ folder). then you can use like this...
>>> import magic
>>> file_magic = magic.Magic(magic_file="C:\Programs\libmagicwin64\magic.mgc")
>>> print(file_magic.from_file("D:\Work Folder\mcabcaaug2016.pdf"))
'PDF document, version 1.4'

Error when installing rpy2 module in Python with easy_install

I've been trying to install the rpy2 module so I can use R functions inside my Python script, but I'm getting an error after following the advice from these pages:
1) Tried to guess R's HOME but no R command in the PATH. OsX 10.6
2) http://rpy.sourceforge.net/rpy2/doc-dev/html/overview.html
What I've done so far:
1) Edited my path environment variable to include "C:\Program Files\R\R-3.1.0\bin\x64;"
2) Created a new environment variable called "R_HOME" and set its value to "C:\Program Files\R\R-3.1.0"
3) Created a new environment variable called "R_USER" and set its value to "Hefin" (my windows username)
Then in my command prompt I type:
easy_install rpy2
As far as I'm aware, easy_install is setup and installed correctly.
The output I get is:
Searching for rpy2
Reading https://pypi.python.org/simple/rpy2/
Best match: rpy2 2.5.5
Downloading https://pypi.python.org/packages/source/r/rpy2/rpy2-2.5.5.tar.gz#md5=c874bebbe775e3cdc926a1da00252c37
Processing rpy2-2.5.5.tar.gz
Writing C:\Users\Hefin\AppData\Local\Temp\easy_install-98mu0_xn\rpy2-2.5.5\setup.cfg
Running rpy2-2.5.5\setup.py -q bdist_egg --dist-dir C:\Users\Hefin\AppData\Local\Temp\easy_install-98mu0_xn\rpy2-2.5.5\egg-dist-tmp-00qpf_z8
The system cannot find the path specified.
Traceback (most recent call last):
File "C:\Python34\lib\site-packages\setuptools-12.0.5-py3.4.egg\setuptools\sandbox.py", line 150, in save_modules
File "C:\Python34\lib\site-packages\setuptools-12.0.5-py3.4.egg\setuptools\sandbox.py", line 191, in setup_context
File "C:\Python34\lib\site-packages\setuptools-12.0.5-py3.4.egg\setuptools\sandbox.py", line 235, in run_setup
File "C:\Python34\lib\site-packages\setuptools-12.0.5-py3.4.egg\setuptools\sandbox.py", line 265, in run
File "C:\Python34\lib\site-packages\setuptools-12.0.5-py3.4.egg\setuptools\sandbox.py", line 234, in runner
File "C:\Python34\lib\site-packages\setuptools-12.0.5-py3.4.egg\setuptools\sandbox.py", line 46, in _execfile
File "C:\Users\Hefin\AppData\Local\Temp\easy_install-98mu0_xn\rpy2-2.5.5\setup.py", line 282, in <module>
File "C:\Users\Hefin\AppData\Local\Temp\easy_install-98mu0_xn\rpy2-2.5.5\setup.py", line 185, in getRinterface_ext
File "C:\Users\Hefin\AppData\Local\Temp\easy_install-98mu0_xn\rpy2-2.5.5\setup.py", line 106, in version
File "C:\Python34\lib\subprocess.py", line 620, in check_output
raise CalledProcessError(retcode, process.args, output=output)
subprocess.CalledProcessError: Command '('C:\\PROGRA~1\\R\\R-31~1.0\\bin\\R', '--version')' returned non-zero exit status 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Python34\Scripts\easy_install-script.py", line 9, in <module>
load_entry_point('setuptools==12.0.5', 'console_scripts', 'easy_install')()
File "C:\Python34\lib\site-packages\setuptools-12.0.5-py3.4.egg\setuptools\command\easy_install.py", line 2244, in main
File "C:\Python34\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Python34\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "C:\Python34\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Python34\lib\site-packages\setuptools-12.0.5-py3.4.egg\setuptools\command\easy_install.py", line 374, in run
File "C:\Python34\lib\site-packages\setuptools-12.0.5-py3.4.egg\setuptools\command\easy_install.py", line 623, in easy_install
File "C:\Python34\lib\site-packages\setuptools-12.0.5-py3.4.egg\setuptools\command\easy_install.py", line 653, in install_item
File "C:\Python34\lib\site-packages\setuptools-12.0.5-py3.4.egg\setuptools\command\easy_install.py", line 838, in install_eggs
File "C:\Python34\lib\site-packages\setuptools-12.0.5-py3.4.egg\setuptools\command\easy_install.py", line 1066, in build_and_install
File "C:\Python34\lib\site-packages\setuptools-12.0.5-py3.4.egg\setuptools\command\easy_install.py", line 1052, in run_setup
File "C:\Python34\lib\site-packages\setuptools-12.0.5-py3.4.egg\setuptools\sandbox.py", line 238, in run_setup
File "C:\Python34\lib\contextlib.py", line 77, in __exit__
self.gen.throw(type, value, traceback)
File "C:\Python34\lib\site-packages\setuptools-12.0.5-py3.4.egg\setuptools\sandbox.py", line 191, in setup_context
File "C:\Python34\lib\contextlib.py", line 77, in __exit__
self.gen.throw(type, value, traceback)
File "C:\Python34\lib\site-packages\setuptools-12.0.5-py3.4.egg\setuptools\sandbox.py", line 162, in save_modules
File "C:\Python34\lib\site-packages\setuptools-12.0.5-py3.4.egg\setuptools\sandbox.py", line 137, in resume
File "C:\Python34\lib\site-packages\setuptools-12.0.5-py3.4.egg\setuptools\compat.py", line 65, in reraise
File "C:\Python34\lib\site-packages\setuptools-12.0.5-py3.4.egg\setuptools\sandbox.py", line 150, in save_modules
File "C:\Python34\lib\site-packages\setuptools-12.0.5-py3.4.egg\setuptools\sandbox.py", line 191, in setup_context
File "C:\Python34\lib\site-packages\setuptools-12.0.5-py3.4.egg\setuptools\sandbox.py", line 235, in run_setup
File "C:\Python34\lib\site-packages\setuptools-12.0.5-py3.4.egg\setuptools\sandbox.py", line 265, in run
File "C:\Python34\lib\site-packages\setuptools-12.0.5-py3.4.egg\setuptools\sandbox.py", line 234, in runner
File "C:\Python34\lib\site-packages\setuptools-12.0.5-py3.4.egg\setuptools\sandbox.py", line 46, in _execfile
File "C:\Users\Hefin\AppData\Local\Temp\easy_install-98mu0_xn\rpy2-2.5.5\setup.py", line 282, in <module>
File "C:\Users\Hefin\AppData\Local\Temp\easy_install-98mu0_xn\rpy2-2.5.5\setup.py", line 185, in getRinterface_ext
File "C:\Users\Hefin\AppData\Local\Temp\easy_install-98mu0_xn\rpy2-2.5.5\setup.py", line 106, in version
File "C:\Python34\lib\subprocess.py", line 620, in check_output
raise CalledProcessError(retcode, process.args, output=output)
subprocess.CalledProcessError: Command '('C:\\PROGRA~1\\R\\R-31~1.0\\bin\\R', '--version')' returned non-zero exit status 1
C:\Users\Hefin>
Sorry it's so verbose! If I then invoke python and try to import the rpy module, I get:
>>> import python
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'python'
>>>
I'm afraid I'm new to Python and I don't know what I'm doing wrong. I've searched through previous forum posts, but none seem to have this problem. I'm using a 64bit machine with Windows 7, Python3.4 and R3.1.0.
Any help or thoughts would be much appreciated as I'm sure it's just something simple I'm doing wrong.
Thank you!
Hefin
There's a much easier way to go about this - install rpy2 from Christoph Gohlke's Python Extension Packages for Windows repository here. Download the rpy2‑2.5.5‑cp34‑none‑win_amd64.whl file (the current version at the time of this writing), change to the download folder on the command line, and run
pip install rpy2‑2.5.5‑cp34‑none‑win_amd64.whl
pip is already included in Python 3.4, and should be used instead of easy_install when installing new modules, as easy_install is deprecated.
Installing rpy2 on windows is straight forward using conda
conda install rpy2

Unable to find vcvarsall.bat

I am trying to run a python project that I have not written myself. This has required me to install a series of new libraries, but more importantly, it has required me to install Cython.
I think I've installed Cython succesfully at this point. I am using MinGW for my compiler. When I try to run the project I get the error
ImportError: Building module RayTrace failed: ['DistutilsPlatformError: Unable to find vcvarsall.bat\n']
As far as I've understood this is about setting the path for the compiler. I have created the distutils.cfg file that says MinGW is the compiler as well as put MinGW in Path.
Where do I go from here?
this is the complete traceback:
Traceback (most recent call last):
File "C:\Users\Marten\Python\DisperseIt\DisperseIt.py", line 5, in <module>
from DisperseProjectDisperseCtrlFrame import *
File "C:\Users\Marten\Python\DisperseIt\DisperseProjectDisperseCtrlFrame.py", line 12, in <module>
import SectionCalc
File "C:\Users\Marten\Python\DisperseIt\SectionCalc.py", line 10, in <module>
from RayTrace import CalcIndices
File "C:\Python27\lib\site-packages\cython-0.20.2-py2.7-win32.egg\pyximport\pyximport.py", line 431, in load_module
language_level=self.language_level)
File "C:\Python27\lib\site-packages\cython-0.20.2-py2.7-win32.egg\pyximport\pyximport.py", line 209, in load_module
inplace=build_inplace, language_level=language_level)
File "C:\Python27\lib\site-packages\cython-0.20.2-py2.7-win32.egg\pyximport\pyximport.py", line 186, in build_module
reload_support=pyxargs.reload_support)
File "C:\Python27\lib\site-packages\cython-0.20.2-py2.7-win32.egg\pyximport\pyxbuild.py", line 104, in pyx_to_dll
dist.run_commands()
File "C:\Python27\lib\distutils\dist.py", line 953, in run_commands
self.run_command(cmd)
File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "C:\Python27\lib\site-packages\cython-0.20.2-py2.7-win32.egg\Cython\Distutils\build_ext.py", line 163, in run
_build_ext.build_ext.run(self)
File "C:\Python27\lib\distutils\command\build_ext.py", line 337, in run
self.build_extensions()
File "C:\Python27\lib\site-packages\cython-0.20.2-py2.7-win32.egg\Cython\Distutils\build_ext.py", line 171, in build_extensions
self.build_extension(ext)
File "C:\Python27\lib\distutils\command\build_ext.py", line 496, in build_extension
depends=ext.depends)
File "C:\Python27\lib\distutils\msvc9compiler.py", line 473, in compile
self.initialize()
File "C:\Python27\lib\distutils\msvc9compiler.py", line 383, in initialize
vc_env = query_vcvarsall(VERSION, plat_spec)
File "C:\Python27\lib\distutils\msvc9compiler.py", line 271, in query_vcvarsall
raise DistutilsPlatformError("Unable to find vcvarsall.bat")
ImportError: Building module RayTrace failed: ['DistutilsPlatformError: Unable to find vcvarsall.bat\n']

easy_install can't install package

I'm trying to write a setup.py file for my python project:
import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
requires = [
'requests',
'simplejson',
'logging',
'rfc3987',
]
setup(name='xxxxxxx',
version='0.1',
description='xxxxxxx API',
url='https://github.com/xxxxxxxx',
packages=find_packages(),
include_package_data=True,
zip_safe=False,
install_requires=requires,
)
When I execute it I'm getting this error:
Searching for rfc3987
Reading http://pypi.python.org/simple/rfc3987/
Best match: rfc3987 1.3.1
Downloading https://pypi.python.org/packages/source/r/rfc3987/rfc3987-1.3.1.tar.gz#md5=397b1c1cd8b934269e53a621d56d9ed2
Processing rfc3987-1.3.1.tar.gz
Running rfc3987-1.3.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-AYV_bv/rfc3987-1.3.1/egg-dist-tmp-G8Kbay
Traceback (most recent call last):
File "/usr/bin/easy_install", line 9, in <module>
load_entry_point('distribute==0.6.10', 'console_scripts', 'easy_install')()
File "/usr/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 1715, in main
with_ei_usage(lambda:
File "/usr/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 1696, in with_ei_usage
return f()
File "/usr/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 1719, in <lambda>
distclass=DistributionWithoutHelpCommands, **kw
File "/usr/lib64/python2.6/distutils/core.py", line 152, in setup
dist.run_commands()
File "/usr/lib64/python2.6/distutils/dist.py", line 975, in run_commands
self.run_command(cmd)
File "/usr/lib64/python2.6/distutils/dist.py", line 995, in run_command
cmd_obj.run()
File "/usr/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 236, in run
self.easy_install(spec, not self.no_deps)
File "/usr/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 472, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/usr/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 502, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/usr/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 681, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/usr/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 958, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/usr/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 947, in run_setup
run_setup(setup_script, args)
File "/usr/lib/python2.6/site-packages/setuptools/sandbox.py", line 29, in run_setup
lambda: execfile(
File "/usr/lib/python2.6/site-packages/setuptools/sandbox.py", line 70, in run
return func()
File "/usr/lib/python2.6/site-packages/setuptools/sandbox.py", line 31, in <lambda>
{'__file__':setup_script, '__name__':'__main__'}
File "setup.py", line 4, in <module>
File "/tmp/easy_install-AYV_bv/rfc3987-1.3.1/rfc3987.py", line 324, in <module>
File "/tmp/easy_install-AYV_bv/rfc3987-1.3.1/rfc3987.py", line 323, in <genexpr>
File "/tmp/easy_install-AYV_bv/rfc3987-1.3.1/rfc3987.py", line 319, in _interpret_unicode_escapes
ValueError: zero length field name in format
If I try just easy_install rfc3987 I'm getting the same error.
Are there any ways to go around this?
rfc3987 claims that it works on Python 2.7 and 3.x. You're trying to install it on 2.6. So it fails.
The problem has nothing to do with your own package, or with easy_install. If you download the tarball manually and run python2.6 setup.py install, you get the same error. And in fact, at least in 1.3.1, there's code that clearly isn't legal under Python 2.6, like this function.
From the git history, it looks like there have been changes to make it Python 2.6 compatible, so the next release may work. Until then, you won't be able to use it from 2.6.

Categories

Resources