Permission denied for python3.5 pip install


#1

Ran this:

 python3.5 -m pip install bs4

and also this:

 pip3 install bs4

Got this:

Downloading/unpacking bs4
Downloading bs4-0.0.1.tar.gz
Running setup.py (path:/tmp/pip_build_ubuntu/bs4/setup.py) egg_info for package bs4

Downloading/unpacking beautifulsoup4 (from bs4)
Downloading beautifulsoup4-4.5.1-py3-none-any.whl (83kB): 83kB downloaded
Installing collected packages: bs4, beautifulsoup4
Running setup.py install for bs4

error: [Errno 13] Permission denied: '/usr/lib/python3.5/site-packages'
Complete output from command /usr/bin/python3.5 -c "import setuptools, tokenize;__file__='/tmp/pip_build_ubuntu/bs4/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-tj6rl3wf-record/install-record.txt --single-version-externally-managed --compile:
running install

running build

running install_egg_info

running egg_info

writing bs4.egg-info/PKG-INFO

writing top-level names to bs4.egg-info/top_level.txt

writing requirements to bs4.egg-info/requires.txt

writing dependency_links to bs4.egg-info/dependency_links.txt

warning: manifest_maker: standard file ‘-c’ not found

reading manifest file ‘bs4.egg-info/SOURCES.txt’

writing manifest file ‘bs4.egg-info/SOURCES.txt’

error: [Errno 13] Permission denied: ‘/usr/lib/python3.5/site-packages’

Cleaning up…
Command /usr/bin/python3.5 -c “import setuptools, tokenize;file=’/tmp/pip_build_ubuntu/bs4/setup.py’;exec(compile(getattr(tokenize, ‘open’, open)(file).read().replace(’\r\n’, ‘\n’), file, ‘exec’))” install --record /tmp/pip-tj6rl3wf-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_ubuntu/bs4
Storing debug log for failure in /home/ubuntu/.pip/pip.log

Need to run beautifulsoup4 for python3, but pip only installs for 2.7 otherwise :frowning:


#2

try adding sudo to your install command:

sudo pip3 install bs4


#3

This just solved 3 problems. Thanks!