How do I install a Python module? - python

Be forewarned, issues related to installing Python make me nervous. I spent an entire morning panicking what would happen when I would install Python 3.
Now on to the task. My computer is an Apple. I would like to add a python module that I have downloaded from the internet. How do I install the package?
I tried 'python setup.py install' but received an error:
error: could not create '/Library/Python/2.7/site-packages/bs4': Permission denied
Please help. Thank you.

Alternatively to installing with elevated privileges, you could also use virtualenv to create a self-contained environment in user space, then install things to that with regular user privileges. This also has other benefits over installing to the system Python, such as keeping your dependencies clear, and not accidentally breaking your system install with some funky package.

You need to use elevated privileges to do this by using sudo
sudo python setup.py install

Related

Installing the ahkab packages of Python

I've one problem, when I try to install the 'ahkab' packages on Linux, Ubuntu based, for Python with the command pip (pip install ahkab).
You can to see my problem on image below. I don't know what do I need to do to solve this case.
I think you may need to run with super user permission while installing.
Use sudo in-front of you command.

Python-Jira installation without Admin rights

I am writing a python tool that should get information from Jira. I wanted to use Python-Jira but cannot install it properly. I am using (have to use) python 2.7 which doesn't come with pip and I cannot install pip because I do not have local admin rights (and won't get them without hassle).
Is there a way to install/use python-jira without the pip installation process? I tried copying the jira package to the site-packages folder but it seems I run into dependency problems ('ImportError: No module named six.moves' when I try import Jira from jira) which to resolve it seems I have to follow the pip installation process.
Thanks for your help.
Install Virtualenv and you will have your own version of Python and Pip, so you should be able to install jira-python properly.
There is a lot of guides how to do it.
For Linux I recommend this one.
General Python Guide

Installing Tweepy on OS x

I have been trying to install tweepy on OSx via
pip install tweepy
I have already installed pip, but I am getting this strange error message I haven't come accross before and, obviously Tweepy doesn't import at all (because it hasn't installed).
I get the following error message:
error: could not create '/Library/Python/2.7/site-packages/tests': Permission denied
Is there any way that I can grant permission? What am I doing wrong?
Thanks in advance
Extra information: running Python 2.7 if you couldn't tell from the path
As mentioned by Alko, you need root access to write to the directory where pip stores the packages.
You can type:
sudo su
in the terminal and then type:
pip install tweepy
Alternatively, you can use virtualenv:
"What if you can't install packages into the global site-packages directory? For instance, on a shared host.
In all these cases, virtualenv can help you. It creates an environment that has its own installation directories, that doesn't share libraries with other virtualenv environments (and optionally doesn't access the globally installed libraries either)."
Basically, it will allow you to create isolated environments for each of your python projects and will allow you to sidestep the permissions issue you are having.
For a good explanation see: Installing Python on Mac OS X: virtualenv

Installing python packages in nitrousio

I've just started trying to use Nitrous.io. I've made a box with python, and am trying to use pip to install a python package called praw.
It downloads all of the information fine, but on running the install script, I get an error stating that it could not create a file due to permission restrictions in the /usr directory. Is there any way to get around this as I need the package for my application to work properly.
You could try pip install --user praw
https://pip.pypa.io/en/latest/user_guide.html#user-installs

Pip install python modules easy

I am looking for an easy way to install/uninstall Python modules and found pip.
Where does pip install to?
I installed as an example "linkify" and it supposed to work but I didnt find it in the sitepackages.
With videodownloader I had a permission denied issue at usr/local/bin.
So I lost my hopes again to find something easy.
Is there a python modules installation for dummies.
Setuptools, http://pypi.python.org/pypi/setuptools includes the EasyInstall tool.
Check out http://packages.python.org/distribute/easy_install.html#downloading-and-installing-a-package to see how to use it.
Once you get that installed it should be ... easy.

Categories

Resources