Airbnb Airflow install error - Permission denied on ../dist-packages/ - python-2.7

I'm trying to install Airflow in Ubuntu 16.04. I get an error when I try:
pip install airflow
Here is the error:
Exception:
Traceback (most recent call last):
File "/home/ashim/.local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/home/ashim/.local/lib/python2.7/site-packages/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/home/ashim/.local/lib/python2.7/site-packages/pip/req/req_set.py", line 784, in install
**kwargs
File "/home/ashim/.local/lib/python2.7/site-packages/pip/req/req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/home/ashim/.local/lib/python2.7/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "/home/ashim/.local/lib/python2.7/site-packages/pip/wheel.py", line 345, in move_wheel_files
clobber(source, lib_dir, True)
File "/home/ashim/.local/lib/python2.7/site-packages/pip/wheel.py", line 316, in clobber
ensure_dir(destdir)
File "/home/ashim/.local/lib/python2.7/site-packages/pip/utils/__init__.py", line 83, in ensure_dir
os.makedirs(path)
File "/usr/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/dateutil'

And I'd like to mention that you should install other package such as sasl client if you want to use more subpackages(hive, hdfs, etc)
conda install -c blaze sasl=0.2.1
conda install -c conda-forge pure-sasl=0.3.0

sudo pip install airflow
or
sudo pip install "airflow[celery,postgres]"
The second command lists the extra packages needed along with airflow.

Give permission to the "/usr/local/lib/python2.7/dist-packages/dateutil" or to the enitre /usr/local/lib

Related

ODOO 8 requires module pyboleto i can't install on python2.7.12

Whats I'll do ?
odoo#odoo-Aspire-ES1-572:~$ pip2 install pyboleto
Collecting pyboleto
Using cached pyboleto-0.3.1.tar.gz
Collecting distribute (from pyboleto)
Using cached distribute-0.7.3.zip
Complete output from command python setup.py egg_info:
running egg_info
creating pip-egg-info/distribute.egg-info
writing requirements to pip-egg-info/distribute.egg-info/requires.txt
writing pip-egg-info/distribute.egg-info/PKG-INFO
writing top-level names to pip-egg-info/distribute.egg-info/top_level.txt
writing dependency_links to pip-egg-info/distribute.egg-info/dependency_links.txt
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-wdypyY/distribute/setup.py", line 58, in <module>
setuptools.setup(**setup_params)
File "/home/odoo/.pyenv/versions/2.7.12/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/home/odoo/.pyenv/versions/2.7.12/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/home/odoo/.pyenv/versions/2.7.12/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "setuptools/command/egg_info.py", line 177, in run
writer = ep.load(installer=installer)
File "pkg_resources.py", line 2241, in load
if require: self.require(env, installer)
File "pkg_resources.py", line 2254, in require
working_set.resolve(self.dist.requires(self.extras),env,installer)))
File "pkg_resources.py", line 2471, in requires
dm = self._dep_map
File "pkg_resources.py", line 2682, in _dep_map
self.__dep_map = self._compute_dependencies()
File "pkg_resources.py", line 2699, in _compute_dependencies
from _markerlib import compile as compile_marker
ImportError: No module named _markerlib
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-wdypyY/distribute/
odoo#odoo-Aspire-ES1-572:~$ pip2 install _markerlib
Invalid requirement: '_markerlib'
Traceback (most recent call last):
File "/home/odoo/.local/lib/python2.7/site-packages/pip/req/req_install.py", line 82, in __init__
req = Requirement(req)
File "/home/odoo/.local/lib/python2.7/site-packages/pip/_vendor/packaging/requirements.py", line 96, in __init__
requirement_string[e.loc:e.loc + 8]))
InvalidRequirement: Invalid requirement, parse error at "'_markerl'"
Please try the following:
sudo apt-get update # Fetches the list of available updates
sudo apt-get upgrade # Strictly upgrades the current packages
sudo apt-get dist-upgrade # Installs updates (new ones)
sudo pip install pyboleto

Installation of Django on ubuntu16.04 using pip faces error

I was trying to install Django1.10 on my ubuntu 16.04 using pip install Django==1.10. Now I'm facing an error which I think is related to directories of installation path but I don't know how to get through. Here is the error:
Exception:
Traceback (most recent call last):
File "/home/atenagm/.local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/home/atenagm/.local/lib/python2.7/site-packages/pip/commands/install.py", line 317, in run
prefix=options.prefix_path,
File "/home/atenagm/.local/lib/python2.7/site-packages/pip/req/req_set.py", line 742, in install
**kwargs
File "/home/atenagm/.local/lib/python2.7/site-packages/pip/req/req_install.py", line 831, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/home/atenagm/.local/lib/python2.7/site-packages/pip/req/req_install.py", line 1032, in move_wheel_files
isolated=self.isolated,
File "/home/atenagm/.local/lib/python2.7/site-packages/pip/wheel.py", line 346, in move_wheel_files
clobber(source, lib_dir, True)
File "/home/atenagm/.local/lib/python2.7/site-packages/pip/wheel.py", line 317, in clobber
ensure_dir(destdir)
File "/home/atenagm/.local/lib/python2.7/site-packages/pip/utils/init.py", line 83, in ensure_dir
os.makedirs(path)
File "/usr/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/Django-1.10.dist-info'
Can anybody tell me what I should do to fix it? Thanks in advance.
You may need super user privilege to install a package globally. So append sudo before your command.
sudo pip install Django==1.10
Running pip as sudo is not the best of choices. That is like giving superuser access to an external application. Rather try this first:
pip install --user django==1.11

Virtualenv throws an error when I try virtualenv -p python3

All of a sudden When I try to add python3 to virtualenv like this
virtualenv -p python3 env
I get the following error
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 209, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 317, in run
prefix=options.prefix_path,
File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 726, in install
requirement.uninstall(auto_confirm=True)
File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 746, in uninstall
paths_to_remove.remove(auto_confirm)
File "/Library/Python/2.7/site-packages/pip/req/req_uninstall.py", line 115, in remove
renames(path, new_path)
File "/Library/Python/2.7/site-packages/pip/utils/__init__.py", line 267, in renames
shutil.move(old, new)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 303, in move
os.unlink(src)
OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/virtualenv-13.1.2.dist-info/DESCRIPTION.rst'
This just started happening out of nowhere a few hours ago because I have been using it tonite. Can anyone tell me what's going on with this? thanks

Trying to install Django

I have been trying to install Django correctly for a while to no avail.
C:\Python34\Scripts\pip.exe install C:\Python34\Lib\site-packages\Django-1.7.2\Django-1.7.2\setup.py
raises an exception and stores the following in a log file:
C:\Python34\Scripts\pip run on 01/12/15 17:47:02
Exception:
Traceback (most recent call last):
File "C:\Python34\lib\site-packages\pip\basecommand.py", line 122, in main
status = self.run(options, args)
File "C:\Python34\lib\site-packages\pip\commands\install.py", line 257, in run
InstallRequirement.from_line(name, None))
File "C:\Python34\lib\site-packages\pip\req.py", line 172, in from_line
return cls(req, comes_from, url=url, prereleases=prereleases)
File "C:\Python34\lib\site-packages\pip\req.py", line 70, in __init__
req = pkg_resources.Requirement.parse(req)
File "C:\Python34\lib\site-packages\pip\_vendor\pkg_resources.py", line 2606, in parse
reqs = list(parse_requirements(s))
File "C:\Python34\lib\site-packages\pip\_vendor\pkg_resources.py", line 2544, in parse_requirements
line, p, specs = scan_list(VERSION,LINE_END,line,p,(1,2),"version spec")
File "C:\Python34\lib\site-packages\pip\_vendor\pkg_resources.py", line 2512, in scan_list
raise ValueError("Expected "+item_name+" in",line,"at",line[p:])
ValueError: ('Expected version spec in', 'C:\\Python34\\Lib\\site-packages\\Django-1.7.2\\Django-1.7.2\\setup.py', 'at', ':\\Python34\\Lib\\site-packages\\Django-1.7.2\\Django-1.7.2\\setup.py')
any help would be greatly appreciated!
THANK YOU
For pip install refer to the directory containing setup.py.
C:\Python34\Scripts\pip.exe install C:\Python34\Lib\site-packages\Django-1.7.2\Django-1.7.2\
But since your path has site-packages in it already (e.g. C:\Python34\Lib\site-packages\) it would seem that it is already installed.
Other alternatives are:
pip install django==1.7.2
pip install django==1.7
python C:...\Django-1.7.2\setup.py install

pip install dj-database-url gives a Permission Denied Error

Doing a "pip install dj-database-url" gave the following errors:
Downloading/unpacking dj-database-url Exception: Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 126, in main
self.run(options, args) File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 223, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle) File "/usr/lib/python2.7/dist-packages/pip/req.py", line 942, in prepare_files
location = req_to_install.build_location(self.build_dir, not self.is_download) File "/usr/lib/python2.7/dist-packages/pip/req.py", line 144, in build_location
_make_build_dir(build_dir) File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1185, in
_make_build_dir
os.makedirs(build_dir) File "/usr/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode) OSError: [Errno 13] Permission denied: '/vagrant/django_projects/microblog/build'
Storing complete log in /var/lib/postgresql/.pip/pip.log
I don't know what i'm doing wrong. Please help.
Setup virtualenv and start it up.
pip install Django psycopg2 south dj-database-url
Use virtualenv or run your command using sudo.