I'm trying to use the Fabric 0.1.1 deploy tool (http://docs.fabfile.org/) on Windows and we're running into an issue with the readline module. I've been through various threads but can't seem to solve the issue. It's important because we can't deploy applications from Windows based machines.
C:\Documents and Settings\dev\Desktop\deploy>fab
Traceback (most recent call last):
File "C:\python\Scripts\fab-script.py", line 8, in <module>
load_entry_point('fabric==0.1.1', 'console_scripts', 'fab')()
File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\pkg_resources.py"
, line 277, in load_entry_point
File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\pkg_resources.py"
, line 2180, in load_entry_point
File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\pkg_resources.py"
, line 1913, in load
File "build\bdist.win32\egg\fabric.py", line 25, in <module>
**ImportError: No module named readline**
Installing the module results in:
**easy_install readline**
Searching for readline
Reading http://pypi.python.org/simple/readline/
Reading http://www.python.org/
Best match: readline 2.6.4
Downloading http://pypi.python.org/packages/source/r/readline/readline-2.6.4.tar
.gz#md5=7568e8b78f383443ba57c9afec6f4285
Processing readline-2.6.4.tar.gz
Running readline-2.6.4\setup.py -q bdist_egg --dist-dir c:\docume~1\ji81b9~1.che
\locals~1\temp\easy_install-pzkz1a\readline-2.6.4\egg-dist-tmp-szs2ps
Traceback (most recent call last):
File "C:\python\Scripts\easy_install-script.py", line 8, in <module>
load_entry_point('setuptools==0.6c9', 'console_scripts', 'easy_install')()
File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\comman
d\easy_install.py", line 1671, in main
File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\comman
d\easy_install.py", line 1659, in with_ei_usage
File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\comman
d\easy_install.py", line 1675, in <lambda>
File "c:\python\lib\distutils\core.py", line 152, in setup
dist.run_commands()
File "c:\python\lib\distutils\dist.py", line 975, in run_commands
self.run_command(cmd)
File "c:\python\lib\distutils\dist.py", line 995, in run_command
cmd_obj.run()
File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\comman
d\easy_install.py", line 211, in run
File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\comman
d\easy_install.py", line 446, in easy_install
File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\comman
d\easy_install.py", line 476, in install_item
File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\comman
d\easy_install.py", line 655, in install_eggs
File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\comman
d\easy_install.py", line 930, in build_and_install
File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\comman
d\easy_install.py", line 919, in run_setup
File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\sandbo
x.py", line 27, in run_setup
File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\sandbo
x.py", line 63, in run
File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\sandbo
x.py", line 29, in <lambda>
File "setup.py", line 93, in <module>
AttributeError: 'module' object has no attribute 'symlink'
Has anybody solved this issue or can anybody suggest a workaround?
The readline module you are trying to install with easy_install is for OS X, not windows. There are Windows-compatible replacements for readline out there but perhaps you should first try updating fabric itself to a more current version (0.9 is out there now).
Grepping the source of the 0.9 version does not find any dependencies on readline.
Following these steps exactly worked for me:
1) Installed using the MSI installer for x86 from here.
2) Installed in the default C:\Python27 directory.
3) Create a new directory: C:\Python27\Scripts
4) Added C:\Python27 and C:\Python27\Scripts to the system path:
5) Download the distribute_setup.py from here into C:\Python27\Scripts
6) Open a command line, navigate to C:\Python27\Scripts, run: 'python distribute_setup.py'
7) now run 'easy_install pip'
8) now run 'pip install fabric'
9) You should get an error saying PyCrypto couldn't install. You can download the pre-build Windows binary from here. Run this to install PyCrypto.
10) run 'pip install fabric' again and it should say everything is installed.
11) in a different directory (let's say c:\dev\hello) create a fabfile.py and add the following code:
def hello(name="world"):
print("Hello %s!" % name)
12) cd to this directory and run 'fab hello:working'. You should see output say
Hello working!
Done.
Give this readline a try. It is a module for Windows that allows additional features in IPython that aren't native and might work with what you are trying to do.
0.1.1 is an older version, I believe. I have no problem installing Fabric on Windows with ActivePython (w/ PyPM):
C:\> pypm install fabric
Ready to perform these actions:
The following packages will be installed:
fabric-0.9.0 pycrypto-2.0.1
Get: [pypm.activestate.com] fabric 0.9.0-1
Get: [pypm.activestate.com] pycrypto 2.0.1-1
Installing fabric-0.9.0
Fixing script C:\Users\sridharr\AppData\Roaming\Python\Scripts\fab-script.py
Installing pycrypto-2.0.1
Download and run easy_install installer for your python version from http://pypi.python.org/pypi/setuptools#downloads . ie: setuptools-0.6c11.win32-py2.6.exe
On the command prompt, lauch easy_install -U fabric to install the last fabric release.
Readline should be available with Cygwin, if you want to move your entire stack in that direction.
Related
I am trying to import some specific libraries using python. it should be easy like importing numpy for example like so:
import osgeo.gdal, gdal
from osgeo.gdalconst import *
But it seemed to me like the packages gdal and osgeo are missing so I went to the project interpreter to add these packages, Sadly i did not find the package osgeo and the package gdal could not be installed ... I looked it up in the net but it seems that there is no exact way to solve the matter.
I am using Ubuntu 16,04 with python 2.7.12 and PS GDAL is Geospatial Data Abstraction Library
This the error message that I am getting:
Collecting gdal
Using cached GDAL-2.2.3.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'
warning: manifest_maker: standard file '-c' not found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pycharm-packaging347/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 "build/bdist.linux-x86_64/egg/setuptools/command/egg_info.py", line 180, in run
File "build/bdist.linux-x86_64/egg/setuptools/command/egg_info.py", line 207, in find_sources
File "build/bdist.linux-x86_64/egg/setuptools/command/egg_info.py", line 291, in run
File "build/bdist.linux-x86_64/egg/setuptools/command/egg_info.py", line 320, in add_defaults
File "build/bdist.linux-x86_64/egg/setuptools/command/sdist.py", line 130, in add_defaults
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/pycharm-packaging347/gdal/setup.py", line 214, in finalize_options
self.gdaldir = self.get_gdal_config('prefix')
File "/tmp/pycharm-packaging347/gdal/setup.py", line 188, in get_gdal_config
return fetch_config(option)
File "/tmp/pycharm-packaging347/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.py egg_info" failed with error code 1 in /tmp/pycharm-packaging347/gdal/
You are using pip version 7.1.0, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Finally I found a solution to my problem.
sudo add-apt-repository ppa:ubuntugis/ppa
sudo apt-get update
sudo apt-get install gdal-bin
sudo apt-get -y install python-gdal
Thank you all for the contribution.
I'm attempting to get FiPy set up using Miniconda 2 on a Windows 7 system, and got to the point of running the test suite with the recommended python -c "import fipy; fipy.test()".
Unfortunately rather than getting test results, the suite gave me an error with stack trace:
running egg_info
creating c:\users\bram\appdata\local\temp\tmpbzt0mv\FiPy.egg-info
writing c:\users\bram\appdata\local\temp\tmpbzt0mv\FiPy.egg-info\PKG-INFO
writing top-level names to c:\users\bram\appdata\local\temp\tmpbzt0mv\FiPy.egg-info\top_level.txt
writing dependency_links to c:\users\bram\appdata\local\temp\tmpbzt0mv\FiPy.egg-info\dependency_links.txt
writing manifest file 'c:\users\bram\appdata\local\temp\tmpbzt0mv\FiPy.egg-info\SOURCES.txt'
warning: manifest_maker: standard file '-c' not found
reading manifest file 'c:\users\bram\appdata\local\temp\tmpbzt0mv\FiPy.egg-info\SOURCES.txt'
writing manifest file 'c:\users\bram\appdata\local\temp\tmpbzt0mv\FiPy.egg-info\SOURCES.txt'
running test
running build_ext
fipy version 3.1.3
numpy version 1.12.0
pysparse is not installed
scipy version 0.18.1
matplotlib is not installed
gist is not installed
mpi4py is not installed
mpi4py is not installed
enthought.mayavi is not installed
gmsh is not installed
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "D:\Users\Bram\Miniconda2\lib\site-packages\fipy\__init__.py", line 164, in test
cmdclass={'test': _TestClass(_test)})
File "D:\Users\Bram\Miniconda2\lib\distutils\core.py", line 151, in setup
dist.run_commands()
File "D:\Users\Bram\Miniconda2\lib\distutils\dist.py", line 953, in run_commands
self.run_command(cmd)
File "D:\Users\Bram\Miniconda2\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "D:\Users\Bram\Miniconda2\lib\site-packages\setuptools-27.2.0-py2.7.egg\setuptools\command\test.py", line 172, in run
File "D:\Users\Bram\Miniconda2\lib\site-packages\fipy\tests\testClass.py", line 236, in run_tests
testLoader = loader_class()
File "D:\Users\Bram\Miniconda2\lib\unittest\main.py", line 94, in __init__
self.parseArgs(argv)
File "D:\Users\Bram\Miniconda2\lib\unittest\main.py", line 149, in parseArgs
self.createTests()
File "D:\Users\Bram\Miniconda2\lib\unittest\main.py", line 158, in createTests
self.module)
File "D:\Users\Bram\Miniconda2\lib\unittest\loader.py", line 130, in loadTestsFromNames
suites = [self.loadTestsFromName(name, module) for name in names]
File "D:\Users\Bram\Miniconda2\lib\unittest\loader.py", line 100, in loadTestsFromName
parent, obj = obj, getattr(obj, part)
AttributeError: 'module' object has no attribute 'testFiPy'
Can anyone help me get this to work? I don't know where to start with this outcome.
Just wanted to add for those who (like me) are new to git and conda - to install the FiPy from develop branch you should (following this answer):
Activate your conda environment: source activate myenv (or activate
myenv for windows)
Install git and pip: conda install git pip
Install FiPy: pip install git+git://github.com/usnistgov/fipy#develop
I am attempting to install pybrains but I am getting this error:
C:\Python34\python.exe "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 4.0.4\helpers\pycharm\pycharm_setup_runner.py" C:\Users\PycharmProjects\Youtube\pybrain-pybrain-87c7ac3\setup.py
Testing started at 14:08 ...
running pycharm_test
running egg_info
writing PyBrain.egg-info\PKG-INFO
writing dependency_links to PyBrain.egg-info\dependency_links.txt
writing top-level names to PyBrain.egg-info\top_level.txt
reading manifest file 'PyBrain.egg-info\SOURCES.txt'
writing manifest file 'PyBrain.egg-info\SOURCES.txt'
running build_ext
Traceback (most recent call last):
File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 4.0.4\helpers\pycharm\pycharm_setup_runner.py", line 26, in <module>
exec (fh.read(), globals(), locals())
File "<string>", line 21, in <module>
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\command\test.py", line 138, in run
self.with_project_on_sys_path(self.run_tests)
File "C:\Python34\lib\site-packages\setuptools\command\test.py", line 118, in with_project_on_sys_path
func()
File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 4.0.4\helpers\pycharm\pycharm_commands\pycharm_test.py", line 18, in run_tests
testLoader=loader_class()
File "C:\PYTHON34\LIB\unittest\main.py", line 92, in __init__
self.parseArgs(argv)
File "C:\PYTHON34\LIB\unittest\main.py", line 139, in parseArgs
self.createTests()
File "C:\PYTHON34\LIB\unittest\main.py", line 146, in createTests
self.module)
File "C:\PYTHON34\LIB\unittest\loader.py", line 146, in loadTestsFromNames
suites = [self.loadTestsFromName(name, module) for name in names]
File "C:\PYTHON34\LIB\unittest\loader.py", line 146, in <listcomp>
suites = [self.loadTestsFromName(name, module) for name in names]
File "C:\PYTHON34\LIB\unittest\loader.py", line 105, in loadTestsFromName
module = __import__('.'.join(parts_copy))
File "c:\users\dhowarth\pycharmprojects\youtube\pybrain-pybrain-87c7ac3\pybrain\__init__.py", line 1, in <module>
from structure.__init__ import *
ImportError: No module named 'structure'
Process finished with exit code 1
Where do I find the 'Structure' module?
Anyone having the same issue?
I have followed the instructions on: https://github.com/pybrain/pybrain/wiki/installation.
what am I missing?
The Pybrain can be setup by pip install pybrain directly.
The FNN in pybrain have a bit problem of convergence and performance. As substitution, there are lots of advices on Python for AI, such as FANN (An example) and scikit-learn (for lots of ML method but not contains FNN directly).
Try not to use pip. I always prefer getting the entire folder from PyPI or github (if available) and then doing the simple python setup.py install.
Also, whenever you do some work with the packages which are under active development (or not very commonly use), please read their documentation.
If you see the documentation : Here. You will see that they use Python 2.x.
And you are clearly using Python 3.x.
Get Python 2.x and download the folder from github. Unzip it and install.
Hope it helps.
Cheers.
Try following queries:
pip install numpy
pip install scipy
pip install pybrain
OR:
download ez_setup.py and run it:
python ez_setup.py
OR:
use easy_install:
easy_install pybrain
I am trying to install Sikuli in Python. I have Python-3.4.1 32 bit on a Windows 7 64 bit machine.
When I execute the command:
pip.exe install sikuli
(pip.exe is installed in -> C:\Python34\Scripts)
It gives me the error:
Downloading/unpacking sikuli Running setup.py
(path:C:\Users\arun_m\AppData\Local\Temp\pip_build_arun_m\sikuli\setup.py)
egg_info for package sikuli
No local packages or download links found for jnius>=1.1-dev
Traceback (most recent call last):
File "", line 17, in
File "C:\Users\arun_m\AppData\Local\Temp\pip_build_arun_m\sikuli\setup.py",
line 39, in
'Development Status :: 4 - Beta'
File "C:\Python34\lib\distutils\core.py", line 108, in setup
_setup_distribution = dist = klass(attrs)
File "C:\Python34\lib\site-packages\setuptools\dist.py", line 239, in init
self.fetch_build_eggs(attrs.pop('setup_requires'))
File "C:\Python34\lib\site-packages\setuptools\dist.py", line 263, in fetch_build_eggs
parse_requirements(requires), installer=self.fetch_build_egg
File "C:\Python34\lib\site-packages\pkg_resources.py", line 564, in resolve
dist = best[req.key] = env.best_match(req, self, installer)
File "C:\Python34\lib\site-packages\pkg_resources.py", line 802, in best_match
return self.obtain(req, installer) # try and download/install
File "C:\Python34\lib\site-packages\pkg_resources.py", line 814, in obtain
return installer(requirement)
File "C:\Python34\lib\site-packages\setuptools\dist.py", line 313, in fetch_build_egg
return cmd.easy_install(req)
File "C:\Python34\lib\site-packages\setuptools\command\easy_install.py",
line 587, in easy_install
raise DistutilsError(msg)
distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('jnius>=1.1-dev')
Complete output from command python setup.py egg_info:
No local packages or download links found for jnius>=1.1-dev
Traceback (most recent call last):
File "", line 17, in
File
"C:\Users\arun_m\AppData\Local\Temp\pip_build_arun_m\sikuli\setup.py",
line 39, in
'Development Status :: 4 - Beta'
File "C:\Python34\lib\distutils\core.py", line 108, in setup
_setup_distribution = dist = klass(attrs)
File "C:\Python34\lib\site-packages\setuptools\dist.py", line 239,
in init
self.fetch_build_eggs(attrs.pop('setup_requires'))
File "C:\Python34\lib\site-packages\setuptools\dist.py", line 263,
in fetch_build_eggs
parse_requirements(requires), installer=self.fetch_build_egg
File "C:\Python34\lib\site-packages\pkg_resources.py", line 564, in
resolve
dist = best[req.key] = env.best_match(req, self, installer)
File "C:\Python34\lib\site-packages\pkg_resources.py", line 802, in
best_match
return self.obtain(req, installer) # try and download/install
File "C:\Python34\lib\site-packages\pkg_resources.py", line 814, in
obtain
return installer(requirement)
File "C:\Python34\lib\site-packages\setuptools\dist.py", line 313,
in fetch_build_egg
return cmd.easy_install(req)
File
"C:\Python34\lib\site-packages\setuptools\command\easy_install.py",
line 587, in easy_install
raise DistutilsError(msg)
distutils.errors.DistutilsError: Could not find suitable distribution
for Requirement.parse('jnius>=1.1-dev')
---------------------------------------- Cleaning up... Command python setup.py egg_info failed with error code 1 in
C:\Users\arun_m\AppData\Local\Temp\pip_build_arun_m\sikuli Storing
debug log for failure in C:\Users\arun_m\pip\pip.log
What do I do to get it installed?
I can execute the Sikuli script from a Python Script but I want to have this installed in Python so that I can use it from within Python by using:
from sikuli import *
Sikuli is not available in CPython (my assumption of what you mean by 'Python'). This would have to be installed 'in' Jython and is still interpreter dependent. I don't use the sikuli IDE because it has no IDE features, but then you run into an issue where Sikuli cannot be run in all IDE's. The IDE must be able to load the .jar correctly. Try Eclipse: http://doc.sikuli.org/faq/040-other-ide.html. My Eclipse project is set up following these directions and I can simply run-as Jython and the script will execute the Sikuli part of the script as expected.
There is no python package available for standalone Sikuli.
Are you trying to install Python-Sikuli-Client as the only sikuli package available at below location
https://pypi.python.org/pypi/python-sikuli-client
SikuliX-1.1.0 is latest Sikuli installation available. It comes in executable jars format and you need JRE 1.6 or higher installed on your system to install SikuliX. It has it's own IDE or you can use Jython as interpreter to compile and run your python scripts written for Sikuli in IDEs like Eclipse with PyDev plugin.
Sikuli script is older version for Sikuli and again it is JAVA jar executable file and needs JRE to run and install it.
For sikuli module installation, you should satisfy the jnius module dependency. jnius installation failed for me, so I built it from sources and installed manually.
After jnius installation, you are free to install sikuli via pip. Before using sikuli, you also need to do the following things:
Add path to JRE jvm.dll to the PATH environment variable, e.g.:
"C:\Program Files (x86)\Java\jre1.8.0_101\bin\client"
Increase JVM heap:
set _JAVA_OPTIONS=-Xmx512M (in Windows)
I am trying to install packages using PIP but it doesn't work for me initially it gives the permission denied error and after that when I tried to use easy_install it gives me this error :->
Searching for mezzanine
Reading https://pypi.python.org/simple/mezzanine/
Reading http://github.com/stephenmcd/mezzanine/
Reading http://mezzanine.jupo.org/
Best match: Mezzanine 3.1.8
Downloading https://pypi.python.org/packages/source/M/Mezzanine/Mezzanine-3.1.8.tar.gz#md5=dcc46016b866ea8de1c87fb9dffd9163
Processing Mezzanine-3.1.8.tar.gz
Writing /tmp/easy_install-2cSSS_/Mezzanine-3.1.8/setup.cfg
Running Mezzanine-3.1.8/setup.py -q bdist_egg --dist-dir /tmp/easy_install-2cSSS_/Mezzanine-3.1.8/egg-dist-tmp-uDjreS
Traceback (most recent call last):
File "/usr/local/bin/easy_install", line 8, in ?
sys.exit(
File "/usr/local/lib/python2.4/site-packages/setuptools/command/easy_install.py", line 1924, in main
with_ei_usage(lambda:
File "/usr/local/lib/python2.4/site-packages/setuptools/command/easy_install.py", line 1911, in with_ei_usage
return f()
File "/usr/local/lib/python2.4/site-packages/setuptools/command/easy_install.py", line 1928, in <lambda>
distclass=DistributionWithoutHelpCommands, **kw
File "/usr/local/lib/python2.4/distutils/core.py", line 149, in setup
dist.run_commands()
File "/usr/local/lib/python2.4/distutils/dist.py", line 946, in run_commands
self.run_command(cmd)
File "/usr/local/lib/python2.4/distutils/dist.py", line 966, in run_command
cmd_obj.run()
File "/usr/local/lib/python2.4/site-packages/setuptools/command/easy_install.py", line 374, in run
self.easy_install(spec, not self.no_deps)
File "/usr/local/lib/python2.4/site-packages/setuptools/command/easy_install.py", line 609, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/usr/local/lib/python2.4/site-packages/setuptools/command/easy_install.py", line 639, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/usr/local/lib/python2.4/site-packages/setuptools/command/easy_install.py", line 825, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/usr/local/lib/python2.4/site-packages/setuptools/command/easy_install.py", line 1031, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/usr/local/lib/python2.4/site-packages/setuptools/command/easy_install.py", line 1016, in run_setup
run_setup(setup_script, args)
File "/usr/local/lib/python2.4/site-packages/setuptools/sandbox.py", line 68, in run_setup
DirectorySandbox(setup_dir).run(
File "/usr/local/lib/python2.4/site-packages/setuptools/sandbox.py", line 120, in run
return func()
File "/usr/local/lib/python2.4/site-packages/setuptools/sandbox.py", line 71, in <lambda>
{'__file__':setup_script, '__name__':'__main__'}
File "setup.py", line 22
with open(e, "r") as f:
^
SyntaxError: invalid syntax
After this when I again try to use pip then I am getting different error (not permission denied) :
File "/home/rishi/bin/pip", line 8, in ?
sys.exit(
File "/usr/local/lib/python2.4/site-packages/pkg_resources.py", line 357, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/local/lib/python2.4/site-packages/pkg_resources.py", line 2394, in load_entry_point
return ep.load()
File "/usr/local/lib/python2.4/site-packages/pkg_resources.py", line 2108, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "/home/rishi/lib/python2.4/pip-1.5.6-py2.4.egg/pip/__init__.py", line 9, in ?
from pip.log import logger
File "/home/rishi/lib/python2.4/pip-1.5.6-py2.4.egg/pip/log.py", line 19
real_consumer = (consumer if not isinstance(consumer, colorama.AnsiToWin32)
^
SyntaxError: invalid syntax
Now I don't know what I am doing wrong , can anybody help me ?
EDIT :- syntex errro solved due to wrong python version , I was using 2.4 .
OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/site-packages/mezzanine'
$which pip result is
~/bin/pip
Just add the --user option to your pip command, it will install with your logged in user permissions:
pip2.7 install mezzanine --user
as Daniel Roseman noted - the syntax error came from using Python2.4
the permission problem is caused by trying to install into system Python, what requires sudo or being root
Possible solutions
Install into system Pyhton (using sudo)
$ sudo pip install mezzanine
This will spoil the system Python and is not much recommended. It would be well acceptable if you are e.g. under Docker.
Install into user profile
$ pip install --user mezzanine
It will install the package into user scheme and will not spoil system Python.
This is more acceptable, but can soon become messy environment to run code in, as Python will import form user scheme, sometime from system.
Use virtualenv
Assuming you have virtualenv installed:
$ cd ~/projects
$ mkdir mezza
$ cd mezza
$ virtualenv venv
$ source venv/bin/activate
(venv)$ pip install mezzanine
$ pip freeze
mezzanine==3.1.8
(there will be a bit more lines from freeze).
This installs into virtualenv, which is easy to recreate, destroy, and does not mess up with other environments.
With virtulanevwrapper you will get set of additional tools, which will simplify your environment a lot.