Unable to run enable.py when trying to install dragonfly - python-dragonfly

I am trying to install dragonfly, i got natlink installed, without problems.
But when i try to run enable.py i keep getting this error:
C:\NatLink>python enable.py
Traceback (most recent call last):
File "enable.py", line 400, in <module>
def unregister_natlink_module(base=natlink_macro_system_path()):
File "enable.py", line 177, in natlink_macro_system_path
return os.path.join(find_natlink(), "MacroSystem")
File "C:\Python27\lib\ntpath.py", line 65, in join
result_drive, result_path = splitdrive(path)
File "C:\Python27\lib\ntpath.py", line 115, in splitdrive
if len(p) > 1:
TypeError: object of type 'NoneType' has no len()
Python version:
Python 2.7.10 (default, May 23 2015, 09:44:00) [MSC v.1500 64 bit (AMD64)] on wi
n32.
How do i proceed from here?

Daniel Rocco's enable.py was for Natlink, not Dragonfly, and is old. To install Dragonfly, download the .zip from Github, and then open a command prompt in the directory you unzip it in and run "python setup.py install". More detailed instructions here and here.

Related

I tried to create my first django project(using powershell) but failed to do so because of errors

I am new to django. I wanted to create my first sample project so I followed all the usual ways(as in youtube) and installed python 3.4,pip,django etc. When the environment was set I typed the below command in windows powershell
django-admin startproject mysiteone
and got the below syntax error message(See last para)
My system uses Windows 7 OS. I was unable to find even the version of django i had installed. I dont know why.
I gave these codes in powershell:
django-admin startproject mysiteone
python -m django --version
Error message that I got as a result:
Traceback (most recent call last):
File "C:\Python34\lib\runpy.py", line 171, in _run_module_as_main "_main_", mod_spec)
File "C:\Python34\lib\runpy.py", line 86, in _run_code exec(code, run_globals)
File "C:\Python34\Scripts\django-admin.exe\_main_.py", line 5, in <module>
File "C:\Python34\lib\site-packages\django\core\management\_init_.py", line 260
subcommands = [*get_commands(), 'help']
SyntaxError: can use starred expression only as assignment target
i had the same problem and i solved by migration to python >= 3.5 , it's an unpacking problem => https://www.python.org/dev/peps/pep-0448/

in virtual env, with centos and pip installed, I can't run a pip freeze

I have a program where I dearly need the dependency list, but pip freeze isn't working. I am running CentOS 7 and Python 2.7.5
The program runs on Python 2.4 (which I am doing as an alias in another terminal, yes, I did try the pip freeze from that terminal) and fortran95. I definitely have pip installed. I tried upgrading the Python2.7, but it says it is fine.
The the error from pip is as follows.
[root#localhost rotate6]# pip freeze
Exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main status = self.run(options, args)
File "/usr/lib/python2.7/site-packages/pip/commands/freeze.py", line 85, in run
for line in freeze(**freeze_kwargs):
File "/usr/lib/python2.7/site-packages/pip/operations/freeze.py", line 47, in freeze
dependency_links
File "/usr/lib/python2.7/site-packages/pip/__init__.py", line 264, in from_dist
req = dist.as_requirement()
File "/usr/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2562, in as_requirement
return Requirement.parse(spec)
File "/usr/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2833, in parse
req, = parse_requirements(s)
File "/usr/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2781, in parse_requirements
yield Requirement(line)
File "/usr/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2790, in __init__
raise RequirementParseError(str(e))
RequirementParseError: Invalid requirement, parse error at "'-ipap11h'"
This is a known issue. See https://github.com/pypa/pip/issues/3764
The advice there is to try downgrading your version of pip to one that is less strict (some people find 8.1.0 works), or to uninstall the offending package, which appears to be _ipap11helper.

Failure to install Python win32 libraries?

Any ideas? I don't have Python in the path & the company won't allow it. I wouldn't expect it to make a difference to a well written installer, but mention it just in case.
H:\code\testgen\pywin32-220>c:\Python27\python.exe --version
Python 2.7.11
H:\code\testgen\pywin32-220>c:\Python27\python.exe setup.py -q install
Building pywin32 2.7.220.0
Traceback (most recent call last):
File "setup.py", line 1944, in <module>
""" % dirs).split(),
File "setup.py", line 594, in __init__
if os.path.isfile(os.path.join(sdk_dir, "include", "activdbg.h")):
File "c:\Python27\lib\ntpath.py", line 65, in join
result_drive, result_path = splitdrive(path)
File "c:\Python27\lib\ntpath.py", line 115, in splitdrive
if len(p) > 1:
TypeError: object of type 'NoneType' has no len()
Despite this post was asked 3 months ago, I faced the same issue today. I found a solution in the end so I would like to share it here. Hope it is still useful.
I found in another post here:
https://www.quora.com/I-tried-to-install-PyWin32-for-Python-2-7-at-Python-for-Windows-Extensions-but-it-did-not-work-How-can-I-install-PyWin32
to install from the wheel distribution instead.
In case you have the same connection problem with pip like me, please download the source of wheel via its git repo:
https://bitbucket.org/pypa/wheel/downloads (choose the version you like, latest probably best). Then install it using
pip install <<_path_to_the_zip_file_downloaded_>>

python3.2 + virtualenv - env create failed

I've got a py2.7 project which I want to test under py3.2. For this purpose, I want to use virtualenv. I wanted to create an environment that would run 3.2 version internally:
virtualenv 3.2 -p /usr/bin/python3.2
but it failed. My default python version is 2.7 (ubuntu default settings). Here is virtualenv --version 1.10. The error output is:
Running virtualenv with interpreter /usr/bin/python3.2
New python executable in 3.2/bin/python3.2
Also creating executable in 3.2/bin/python
Installing Setuptools...................................................................................................................................................................................................................................done.
Installing Pip..............
Complete output from command /home/tomasz/Develop...on/3.2/bin/python3.2 setup.py install --single-version-externally-managed --record record:
Traceback (most recent call last):
File "setup.py", line 5, in <module>
from setuptools import setup, find_packages
File "/usr/lib/python2.7/dist-packages/setuptools/__init__.py", line 2, in <module>
from setuptools.extension import Extension, Library
File "/usr/lib/python2.7/dist-packages/setuptools/extension.py", line 2, in <module>
from setuptools.dist import _get_unpatched
File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 103
except ValueError, e:
^
SyntaxError: invalid syntax
----------------------------------------
...Installing Pip...done.
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 2308, in <module>
main()
File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 821, in main
symlink=options.symlink)
File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 963, in create_environment
install_sdist('Pip', 'pip-*.tar.gz', py_executable, search_dirs)
File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 932, in install_sdist
filter_stdout=filter_install_output)
File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 899, in call_subprocess
% (cmd_desc, proc.returncode))
OSError: Command /home/tomasz/Develop...on/3.2/bin/python3.2 setup.py install --single-version-externally-managed --record record failed with error code 1
I don't know what the hell is this syntax error - where does it come from... I know there was a change in try...catch statement syntax between 2.x and 3.x, but should virtualenv throw syntax errors?
I'd be grateful if someone pointed me out if there's something I'm doing wrong or if there is an installation problem on my machine.
To create a Python 3.2 virtual environment you should use the virtualenv you installed for Python 3.2. In your case that would be:
/usr/bin/virtualenv-3.2
You'll have to use a Python 3 version of virtualenv; the version you are using is installing Python 2 tools into a Python 3 virtual environment and these are not compatible.
virtualenv --python=/usr/bin/python3.2 --no-site-packages ENV

Decide which python version to use for pip and easy_install

I have two python versions on my server namely 2.4 and 2.7. It is running RHEL 5.8.
I already have pip and easy_install installed on my server.
When I try to install ipython using easy_install or pip, it gives me an error which probably does not support in python 2.4.
I want to use python 2.7 for both pip and easy_install since I would want to use the latest version of the both.
What should I do to have pip and easy_install use python 2.7. Python 2.4 is installed by default by the system and I do want to keep it.
Python 2.7 is installed at another location.
Below is the traceback both for easy_install and pip. Both end up in the same error. Any kind of help is appreciated.
PIP
ronak#ronak fun $ sudo pip install ipython
Downloading/unpacking ipython
Downloading ipython-0.13.zip (6.4Mb): 6.4Mb downloaded
Running setup.py egg_info for package ipython
Traceback (most recent call last):
File "<string>", line 14, in ?
File "/usr/local/home/ronak/fun/build/ipython/setup.py", line 23
from __future__ import print_function
SyntaxError: future feature print_function is not defined
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 14, in ?
File "/usr/local/home/ronak/fun/build/ipython/setup.py", line 23
from __future__ import print_function
SyntaxError: future feature print_function is not defined
----------------------------------------
Command python setup.py egg_info failed with error code 1
Storing complete log in /home/ronak/.pip/pip.log
EASY_INSTALL:
ronak#ronak $ sudo easy_install ipython
Searching for ipython
Reading http://pypi.python.org/simple/ipython/
Reading http://ipython.scipy.org
Reading http://ipython.scipy.org/dist
Reading http://ipython.scipy.org/dist/0.8.4
Reading http://ipython.scipy.org/dist/0.9.1
Reading http://ipython.org
Reading http://archive.ipython.org/release/0.12.1
Reading https://github.com/ipython/ipython/downloads
Reading http://ipython.scipy.org/dist/old/0.9
Reading http://ipython.scipy.org/dist/0.10
Reading http://archive.ipython.org/release/0.11/
Reading http://archive.ipython.org/release/0.12
Best match: ipython 0.13
Downloading https://github.com/downloads/ipython/ipython/ipython-0.13.zip
Processing ipython-0.13.zip
Running ipython-0.13/setup.py -q bdist_egg --dist-dir /tmp/easy_install-vgPLN2/ipython-0.13/egg-dist-tmp-GHUgsq
Traceback (most recent call last):
File "/usr/bin/easy_install", line 7, in ?
sys.exit(
File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/setuptools/command/easy_install.py", line 1712, in main
with_ei_usage(lambda:
File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/setuptools/command/easy_install.py", line 1700, in with_ei_usage
return f()
File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/setuptools/command/easy_install.py", line 1716, in <lambda>
distclass=DistributionWithoutHelpCommands, **kw
File "/usr/lib/python2.4/distutils/core.py", line 149, in setup
dist.run_commands()
File "/usr/lib/python2.4/distutils/dist.py", line 946, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.4/distutils/dist.py", line 966, in run_command
cmd_obj.run()
File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/setuptools/command/easy_install.py", line 211, in run
self.easy_install(spec, not self.no_deps)
File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/setuptools/command/easy_install.py", line 446, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/setuptools/command/easy_install.py", line 476, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/setuptools/command/easy_install.py", line 655, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/setuptools/command/easy_install.py", line 930, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/setuptools/command/easy_install.py", line 919, in run_setup
run_setup(setup_script, args)
File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/setuptools/sandbox.py", line 61, in run_setup
DirectorySandbox(setup_dir).run(
File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/setuptools/sandbox.py", line 105, in run
return func()
File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/setuptools/sandbox.py", line 64, in <lambda>
{'__file__':setup_script, '__name__':'__main__'}
File "setup.py", line 23
from __future__ import print_function
SyntaxError: future feature print_function is not defined
One way would be:
Open pip/easy_install in text editor
Check top line, it should say
#! /usr/bin/python
Change it to #!path/to/python2.7
You should check this SO question.
You may also want to consider using virtual environment through virtualenv and virtualenvwrapper to manage which version of Python your packages should use.
If you would like to easily install iPython, SciPy, MatPlotLib, etc. by downloading a .dmg, you can try here:
http://www.enthought.com/products/epd_free.php
Or if you have a academic email address:
http://www.enthought.com/products/edudownload.php
sudo /location/to/python2.7 /path/to/pip install ipython
If you have a recent version of pip, you an also try sudo pip-2.7 install ipython