Trouble installing django-imagekit - 'execfile' is not defined - python

I am having problems installing django-imagekit under python 3.2/django 1.5. Is django-imagekit only for python 2 (then why is it available in pip-3.2)?
Trying to install django-imagekit from within my virtualenv.
------------------------------------------------------------
/home/testuser/webapps/app/bin/pip run on Tue Nov 19 10:38:45 2013
Downloading/unpacking django-imagekit
Running setup.py egg_info for package django-imagekit
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "/home/testuser/webapps/app/build/django-imagekit/setup.py", line 25, in <module>
execfile(os.path.join(os.path.dirname(__file__),
NameError: name 'execfile' is not defined
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "/home/testuser/webapps/app/build/django-imagekit/setup.py", line 25, in <module>
execfile(os.path.join(os.path.dirname(__file__),
NameError: name 'execfile' is not defined
----------------------------------------
Command python setup.py egg_info failed with error code 1 in /home/testuser/webapps/app/build/django-imagekit
Exception information:
Traceback (most recent call last):
File "/home/testuser/webapps/app/lib/python3.2/site-packages/pip-1.1-py3.2.egg/pip/basecommand.py", line 104, in main
status = self.run(options, args)
File "/home/testuser/webapps/app/lib/python3.2/site-packages/pip-1.1-py3.2.egg/pip/commands/install.py", line 245, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/home/testuser/webapps/app/lib/python3.2/site-packages/pip-1.1-py3.2.egg/pip/req.py", line 1009, in prepare_files
req_to_install.run_egg_info()
File "/home/testuser/webapps/app/lib/python3.2/site-packages/pip-1.1-py3.2.egg/pip/req.py", line 225, in run_egg_info
req_to_install.run_egg_info()
File "/home/testuser/webapps/app/lib/python3.2/site-packages/pip-1.1-py3.2.egg/pip/req.py", line 225, in run_egg_info
command_desc='python setup.py egg_info')
File "/home/testuser/webapps/app/lib/python3.2/site-packages/pip-1.1-py3.2.egg/pip/__init__.py", line 256, in call_subprocess
% (command_desc, proc.returncode, cwd))
pip.exceptions.InstallationError: Command python setup.py egg_info failed with error code 1 in /home/testuser/webapps/app/build/django-imagekit

It doesn't look like this module has been updated for python3 yet. Django has only officially supported python3 since 1.5, so several packages have yet to update.

I'm the maintainer of django-imagekit and, unfortunately, it isn't quite ready for Python 3 yet. As for why it's "available" for pip-3.2…My understanding is that pip doesn't do any filtering of packages based on the version of Python you're using; pip-3.2 is named that way because it installs packages into Python 3.2, but it doesn't use a separate index.
EDIT:
We just pushed ImageKit 3.2 which has support for Python 3! Give it a try (:

Related

ModuleNotFoundError: No module named 'Cython' when installing pyarrow

I am trying to install packages from requirements.txt in a virtualenv. However, when pip comes to installing pyarrow, it fails with the following:
Collecting pyarrow==0.9.0 (from -r requirements.txt (line 41))
Using cached https://files.pythonhosted.org/packages/be/2d/11751c477e4e7f4bb07ac7584aafabe0d0608c170e4bff67246d695ebdbe/pyarrow-0.9.0.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/tj/nzhk3hh12074tfyhtgpkw0zm0000gn/T/pip-install-dgdvn2c1/pyarrow/setup.py", line 29, in <module>
from Cython.Distutils import build_ext as _build_ext
ModuleNotFoundError: No module named 'Cython'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/tj/nzhk3hh12074tfyhtgpkw0zm0000gn/T/pip-install-dgdvn2c1/pyarrow/
I am using Python 3.6.3 and Pip 18.0
What I tried:
Most of the SO answers ask to check if python and pip refer to the venv python and I am sure it does.
$ which python
/Users/ME/repos/myproject/venv/bin/python
(venv)
I also tried installing cython via pip and even then installation fails albeit with a different error.
How do I solve this?
Edit:
Stacktrace after installing Cython:
Collecting pyarrow==0.9.0 (from -r requirements.txt (line 41))
Using cached https://files.pythonhosted.org/packages/be/2d/11751c477e4e7f4bb07ac7584aafabe0d0608c170e4bff67246d695ebdbe/pyarrow-0.9.0.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/tj/nzhk3hh12074tfyhtgpkw0zm0000gn/T/pip-install-98s3ff2r/pyarrow/setup.py", line 508, in <module>
url="https://arrow.apache.org/"
File "/Users/ME/Work/myproject/venv/lib/python3.6/site-packages/setuptools/__init__.py", line 131, in setup
return distutils.core.setup(**attrs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/core.py", line 108, in setup
_setup_distribution = dist = klass(attrs)
File "/Users/ME/Work/myproject/venv/lib/python3.6/site-packages/setuptools/dist.py", line 370, in __init__
k: v for k, v in attrs.items()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 281, in __init__
self.finalize_options()
File "/Users/ME/Work/myproject/venv/lib/python3.6/site-packages/setuptools/dist.py", line 529, in finalize_options
ep.load()(self, ep.name, value)
File "/private/var/folders/tj/nzhk3hh12074tfyhtgpkw0zm0000gn/T/pip-install-98s3ff2r/pyarrow/.eggs/setuptools_scm-3.0.5-py3.6.egg/setuptools_scm/integration.py", line 23, in version_keyword
dist.metadata.version = get_version(**value)
File "/private/var/folders/tj/nzhk3hh12074tfyhtgpkw0zm0000gn/T/pip-install-98s3ff2r/pyarrow/.eggs/setuptools_scm-3.0.5-py3.6.egg/setuptools_scm/__init__.py", line 135, in get_version
parsed_version = _do_parse(config)
File "/private/var/folders/tj/nzhk3hh12074tfyhtgpkw0zm0000gn/T/pip-install-98s3ff2r/pyarrow/.eggs/setuptools_scm-3.0.5-py3.6.egg/setuptools_scm/__init__.py", line 77, in _do_parse
parse_result = _call_entrypoint_fn(config, config.parse)
File "/private/var/folders/tj/nzhk3hh12074tfyhtgpkw0zm0000gn/T/pip-install-98s3ff2r/pyarrow/.eggs/setuptools_scm-3.0.5-py3.6.egg/setuptools_scm/__init__.py", line 40, in _call_entrypoint_fn
return fn(config.absolute_root)
File "/private/var/folders/tj/nzhk3hh12074tfyhtgpkw0zm0000gn/T/pip-install-98s3ff2r/pyarrow/setup.py", line 462, in parse_version
return version_from_scm(root)
File "/private/var/folders/tj/nzhk3hh12074tfyhtgpkw0zm0000gn/T/pip-install-98s3ff2r/pyarrow/.eggs/setuptools_scm-3.0.5-py3.6.egg/setuptools_scm/__init__.py", line 28, in version_from_scm
return _version_from_entrypoint(root, "setuptools_scm.parse_scm")
File "/private/var/folders/tj/nzhk3hh12074tfyhtgpkw0zm0000gn/T/pip-install-98s3ff2r/pyarrow/.eggs/setuptools_scm-3.0.5-py3.6.egg/setuptools_scm/__init__.py", line 44, in _version_from_entrypoint
for ep in iter_matching_entrypoints(config.absolute_root, entrypoint):
AttributeError: 'str' object has no attribute 'absolute_root'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/tj/nzhk3hh12074tfyhtgpkw0zm0000gn/T/pip-install-98s3ff2r/pyarrow/
This is a known issue (#2163) with pyarrow that has been closed without a fix.
It's worth noting that there is no pyarrow 0.9.0 wheel available for MacOS in pypi. It was made available in a subsequent 0.9.0.post1 release.
The following should work with Python 3.6 on MacOS:
pip install pyarrow==0.9.0.post1

"python setup.py egg_info" error for pyproj package but not others

I've been trying to install the pyproj python package (I want to use the stateplane part specifically). Long story short.. I have a csv of lat, long, and a variable value and wanted to extract data for each state. I was going to use the
stateplane.identify(-80.1, 36.2, fmt='short')
feature to identify the state. I have verified that I have python 3.6.3 and pip 9.0.1. Doing pip install worked for the libusb package, but I'm getting an error when I do
pip install pyproj
Collecting pyproj
Using cached pyproj-1.9.5.1.tar.gz
Complete output from command python setup.py egg_info:
using bundled proj4..
Traceback (most recent call last):
File "c:\python36-32\lib\site-packages\setuptools\msvc.py", line 490, in _
find_latest_available_vc_ver
return self.find_available_vc_vers()[-1]
IndexError: list index out of range
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\smshp\AppData\Local\Temp\pip-build-_bzisu0o\pyproj\setup.py
", line 72, in <module>
objects = cc.compile(['nad2bin.c', 'src/pj_malloc.c'])
File "c:\python36-32\lib\distutils\_msvccompiler.py", line 345, in compile
self.initialize()
File "c:\python36-32\lib\distutils\_msvccompiler.py", line 238, in initial
ize
vc_env = _get_vc_env(plat_spec)
File "c:\python36-32\lib\site-packages\setuptools\msvc.py", line 185, in m
svc14_get_vc_env
return EnvironmentInfo(plat_spec, vc_min_ver=14.0).return_env()
File "c:\python36-32\lib\site-packages\setuptools\msvc.py", line 844, in _
_init__
self.si = SystemInfo(self.ri, vc_ver)
File "c:\python36-32\lib\site-packages\setuptools\msvc.py", line 486, in _
_init__
self.vc_ver = vc_ver or self._find_latest_available_vc_ver()
File "c:\python36-32\lib\site-packages\setuptools\msvc.py", line 493, in _
find_latest_available_vc_ver
raise distutils.errors.DistutilsPlatformError(err)
distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 is requir
ed. Get it with "Microsoft Visual C++ Build Tools":
http://landinghub.visualstud
io.com/visual-cpp-build-tools
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in
C:\Users\smshp\Ap
pData\Local\Temp\pip-build-_bzisu0o\pyproj\
I have followed the troubleshooting tips from this post word to no avail.
Alternatively, if I downloaded the repo and did
python setup.py install
would I download the .whl or tar.gz file and would I download it to the python36-32 directory or where?
Thanks!

Robotframework-selenium2library installation on linux failed due to NameError with execfile

I want to install the Selenium2Library.
When I run:
sudo easy_install robotframework-selenium2library
in my Ubuntu console I get the error:
File "/usr/local/lib/python3.4/dist-packages/setuptools/sandbox.py", line 242, in runner
_execfile(setup_script, ns)
File "/usr/local/lib/python3.4/dist-packages/setuptools/sandbox.py", line 46, in _execfile
exec(code, globals, locals)
File "/tmp/easy_install-msislfw7/robotframework-selenium2library-1.7.4/setup.py", line 11, in <module>
NameError: name 'execfile' is not defined
Is this a version conflict between Python 2.7 and Python 3.4?
Could I provide more information?
EDIT:
When I run:
pip install robotframework-selenium2library
I get the error:
Collecting robotframework-selenium2library
Using cached robotframework-selenium2library-1.7.4.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-hw1y4ldv/robotframework-selenium2library/setup.py", line 11, in <module>
execfile(join(dirname(__file__), 'src', 'Selenium2Library', 'version.py'))
NameError: name 'execfile' is not defined
Maybe I mixed up my Python 2.7 and Python 3.4 because execfile is used by Python 2.7 only. How to solve this problem?

Pytsk install failure: Unable to locate SleuthKit header files using ubuntu 12.04

Currently having issues locating SleuthKit (3.2.3-2ubuntu1) header files when attempting to install pytsk in Ubuntu 12.04. This is the installation error I am receiving:
Downloading/unpacking pytsk
Downloading pytsk-4.1.3-20140506.tar.gz (142kB): 142kB downloaded
Running setup.py (path:/tmp/pip_build_root/pytsk/setup.py) egg_info for package pytsk
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip_build_root/pytsk/setup.py", line 117, in <module>
raise EnvironmentError('Unable to locate SleuthKit header files.')
EnvironmentError: Unable to locate SleuthKit header files.
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip_build_root/pytsk/setup.py", line 117, in <module>
raise EnvironmentError('Unable to locate SleuthKit header files.')
EnvironmentError: Unable to locate SleuthKit header files.
Log from /home/some_jerk/.pip/ reads as follows:
------------------------------------------------------------
/usr/local/bin/pip run on Thu Feb 12 12:12:28 2015
Downloading/unpacking pytsk
Getting page https://pypi.python.org/simple/pytsk/
URLs to search for versions for pytsk:
* https://pypi.python.org/simple/pytsk/
Analyzing links from page https://pypi.python.org/simple/pytsk/
Found link https://pypi.python.org/packages/2.7/p/pytsk/pytsk-4.1.3-20140506.linux-x86_64.tar.gz#md5=dbc9cce02bb318d5f3145dd23ffa93f7 (from https://pypi.python.org/simple/pytsk/), version: 4.1.3-20140506.linux-x86_64
Found link https://pypi.python.org/packages/source/p/pytsk/pytsk-4.1.3-20140506.tar.gz#md5=a0d0c7af34b6873334d48a61295e51eb (from https://pypi.python.org/simple/pytsk/), version: 4.1.3-20140506
Ignoring link https://pypi.python.org/packages/2.7/p/pytsk/pytsk-4.1.3-20140506.linux-x86_64.tar.gz#md5=dbc9cce02bb318d5f3145dd23ffa93f7 (from https://pypi.python.org/simple/pytsk/), version 4.1.3-20140506.linux-x86_64 is a pre-release (use --pre to allow).
Downloading from URL https://pypi.python.org/packages/source/p/pytsk/pytsk-4.1.3-20140506.tar.gz#md5=a0d0c7af34b6873334d48a61295e51eb (from https://pypi.python.org/simple/pytsk/)
Running setup.py (path:/tmp/pip_build_root/pytsk/setup.py) egg_info for package pytsk
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip_build_root/pytsk/setup.py", line 117, in <module>
raise EnvironmentError('Unable to locate SleuthKit header files.')
EnvironmentError: Unable to locate SleuthKit header files.
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip_build_root/pytsk/setup.py", line 117, in <module>
raise EnvironmentError('Unable to locate SleuthKit header files.')
EnvironmentError: Unable to locate SleuthKit header files.
----------------------------------------
Cleaning up...
Removing temporary dir /tmp/pip_build_root...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/pytsk
Exception information:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/pip-1.5.6-py2.7.egg/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/local/lib/python2.7/dist-packages/pip-1.5.6-py2.7.egg/pip/commands/install.py", line 278, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/usr/local/lib/python2.7/dist-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 1229, in prepare_files
req_to_install.run_egg_info()
File "/usr/local/lib/python2.7/dist-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 325, in run_egg_info
command_desc='python setup.py egg_info')
File "/usr/local/lib/python2.7/dist-packages/pip-1.5.6-py2.7.egg/pip/util.py", line 697, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/pytsk
After some google-fu and referencing the pytsk troubleshooting documentation on GitHub I haven’t found anything that addresses this issue. In my research I also came across some instructions on an install using the more forthright method of Debian package tools instead of apt-get, but this seems to be tailored to development on SleuthKit 4.1.2.
Are there dependencies missing from the pytsk documentation, is this an issue with version conflicts (i.e. a SleuthKit 3.2.3 install trying to pull 4.1.3 from source), or am I missing something obvious?
Thanks in advance, hive mind.
You need the header files, however these aren't installed by default.
apt-get (or whatever) install libtsk

Registry error when installing MySQL-python into virtualenv using pip and easy_install

The pip and easy install commands (install MySQL-python) provide the massive error listed below.
I've been looking around for an answer a while now on this site and through google. The recurring answer is to install python dev (pip install python-dev) however the response I receive is "no distributions at all found"
Does anyone know the correct syntax in order to do this? or could someone be kind enough to point out where I'm going wrong.
All help is greatly appreciated. Thanks
C:\virtualenvs\myvirtualenv2\Scripts\pip-script.py run on 04/13/11 16:28:18
Downloading/unpacking mySQL-python
Running setup.py egg_info for package mySQL-python
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "C:\virtualenvs\myvirtualenv2\build\mySQL-python\setup.py", line 15, in <module>
metadata, options = get_config()
File "setup_windows.py", line 7, in get_config
serverKey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, options['registry_key'])
WindowsError: [Error 2] The system cannot find the file specified
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "C:\virtualenvs\myvirtualenv2\build\mySQL-python\setup.py", line 15, in <module>
metadata, options = get_config()
File "setup_windows.py", line 7, in get_config
serverKey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, options['registry_key'])
WindowsError: [Error 2] The system cannot find the file specified
----------------------------------------
Command python setup.py egg_info failed with error code 1
Exception information:
Traceback (most recent call last):
File "C:\virtualenvs\myvirtualenv2\lib\site-packages\pip-1.0-py2.6.egg\pip\basecommand.py", line 126, in main
self.run(options, args)
File "C:\virtualenvs\myvirtualenv2\lib\site-packages\pip-1.0-py2.6.egg\pip\commands\install.py", line 223, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "C:\virtualenvs\myvirtualenv2\lib\site-packages\pip-1.0-py2.6.egg\pip\req.py", line 980, in prepare_files
req_to_install.run_egg_info()
File "C:\virtualenvs\myvirtualenv2\lib\site-packages\pip-1.0-py2.6.egg\pip\req.py", line 216, in run_egg_info
command_desc='python setup.py egg_info')
File "C:\virtualenvs\myvirtualenv2\lib\site-packages\pip-1.0-py2.6.egg\pip\__init__.py", line 255, in call_subprocess
% (command_desc, proc.returncode))
InstallationError: Command python setup.py egg_info failed with error code 1
Try ActivePython:
pypm -E C:\virtualenvs\myvirtualenv2 install mysql-python
no compile orgy. no strange errors. no terror.
Installing mysqldb on windows is tricky. I can install it manually, after downloading and unpacking mySQL-python:
Go to MySQL-python-1.2.3 folder
Edit the file site.cfg
Run regedit in Start > Run and verify the proper path for MySQL, mine looks like SOFTWARE\MySQL AB\MySQL Server 5.1
Uncomment the line registry_key
Set it:
registry_key = SOFTWARE\MySQL AB\MySQL Server 5.1
Run python setup.py install under your virtualenv

Categories

Resources