Installing python packages in nitrousio - python

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

Related

Pip upgrading arcgis completely broke pip

Overview: While running Python 3.6, after upgrading my arcgis package, scripts no longer recognizes many packages and pip itself completely broke, making it impossible to upgrade or uninstall any packages.
Background Info: Fairly recently, when I run a particular program of mine, I have been seeing a deprecation message connected to the arcgis package. So, I upgraded the arcgis package to see if it fixed it. It seemed to install correctly but then when trying to run my program, I'd get errors for other packages, like folium or requests. I then tried upgrading Python and initially, it worked. I used pip to install pandas and requests but right after I installed arcgis, everything broke again. So then when trying to uninstall arcgis (or do anything else pip related) I get this error:
FileExistsError: [WinError 183] Cannot create a file when that file already exists: 'C:\Users\myuserpath\AppData\Local\.certifi'
I've uninstalled Python but it doesn't change anything. pip install any package results in this error. I tried reverting back to Python 3.6 but the installer wasn't available from the python site, only 3.9.
What could have been changed or affected by this arcgis installation?
There seems to be two primary issues you're dealing with. The first is as #BoarGules mentioned, that arcgis does a 'full' install with all its dependencies and that could be causing problems. Secondly, the newest requests library seems to have some issues as well, at least from what I've experienced. So let's get started fixing all this.
There's probably a few different ways to fix this, so this is just one of the many. First, uninstall python and delete the python folder from your AppData folder - in your case, it would be the Python 3.9 folder. Re-install Python and check your site-packages folder making sure it only contains the default Python packages. Open up a command prompt and do a pip install of something basic, like pandas. If that goes well, then the first hurdle is over.
When it comes time to install arcgis again, you'll want to use this instead
pip install arcgis --no-deps
this will prevent the doubling up of any of the packages or whatever seems to be happening. You will need to then also install these:
pip install ujson
pip install requests_ntlm
Next, when you come to installing requests, use an older library, like this one:
pip install requests==2.20.0
That should get things back up and running.

Python package: pywin32_postinstall returns error

I'm trying to run python script as a windows service and then I need to use pywin32.
After installation pywin32 via pip install I should run pywin32_postinstall as python pywin32_postinstall -install. I've got this reply and have no idea about this situation anymore:
'scripts/pywin32_postinstall.py' not found in metadata at c:\python\lib\site-packages\
As a result I can't run my service.
Did You meet similar situation or have You any ideas?
I solved my problem!
Don't install via pip
Just need to download suitable file from here: https://github.com/mhammond/pywin32/releases
After the installation run python pywin32_postinstall -install and no errors will not occur.
try running "python scripts\pywin32_postinstall.py -install" from the root of the install directory

Syntax Error from 'pip install' in python + command line

Okay, so, I'm running Python 3.4.3 with pip 9.0.1, with the setuptools and wheel.
I'm running this inside JetBrains PyCharm Professional 2017.2.3.
The issue I'm having is trying to install the twitter api packages from this tutorial (ya I'm a n00b) http://wiki.openhatch.org/Twitter
I'm struggling with installing the 4 dependencies mentioned in the first part of the tutorial (httplib2, simplejson, oauth2 and python-twitter)
Honestly, I'm just getting back into programming and this is a project I'd like to complete.
So, I need help with:
Installing pip, and how to use it, and where (python shell or command line or)
the dev.twitter.com website (and where to find what I need from there)
Any help is massively appreciated and sorry if I sound really n00by, but do correct me where I'm using incorrect terms etc because that's how I learn I guess :)
If you haven't got pip installed, find your python installation file.Execute it and choose 'Change Python Installation'. Now choose 'pip' to install and 'add python.exe to path'. Wait for it to finish. Now run windows command line and type:
pip install package_name
Sometimes you may experience that a package isn't available on pip or doesn't work.There are 2 common (not always working) ways to install a package without making pip download the file:
1) A package may be available as a .whl file for download.Download it.Now find it and copy its name .Open a command line in dictionary where it is located and type
pip install **now paste the filename and add .whl**'
2)A package is available as a zip file.Packages are often packed into a zip file.Download the file and extract it.Open a command line in it's directory.You may see setup.py file.Run
python setup.py install
When finished installing pip and adding python to path,you can run:
pip install httplib2 simplejson oauth2 python-twitter
Done.
Once you have pip installed, open the command prompt and just type pip install name_of_the_extension.
In this case, pip install httplib2 will install this package.
I believe you have pip installed on your computer, so it shouldn't be a problem to install the 4 packages you need.

Use pip with non-standard Python installation (non-root installation)?

I'm trying to get up and running with Python 3.5.2 and various packages on a server I work on, but don't have root privileges for. I installed Python to my home, and that seems to be working. I'm trying to set it up so I can install packages to that Python installation (ie ~/lib/python3.5/site-packages) via pip, but I cannot get it working.
Even after adding ~/lib/python3.5/site-packages to $PYTHONPATH, no luck.
Running pip install pandas, I get the error /usr/local/bin/python3.5: bad interpreter: No such file or directory , so it's still looking in the wrong spot. It should be looking at ~/bin/python3.5. Setting an --install-option="--prefix= argument doesn't change the problem.
Is this possible to do?
Try this:
pip3 install --user "library name"

Installing Python imaging library (PIL) on Ubuntu

Something that probably shouldn't be causing me so many problems, is.
I'm trying to install PIL on my Ubuntu server. It's installing fine. However every time I try and update the database to add the image field I get the following error:
Error: One or more models did not validate:
product.product: "image": To use ImageFields, you need to install the Python Imaging Library. Get it at http://www.pythonware.com/products/pil/ .
I've just realised I have been logged in as my user. Do i need to be logged in as root to install it? I'm doing this on a VPS not a local machine.
I've tried loads of tutorials on the web and not getting anywhere at all.
I had to install python-dev then install PIL inside my virtualenv.
All working now.
Thanks for your help all! :)
If you are not root, then entering the following command should install python-imaging:
sudo apt-get install python-imaging
Or (if you are root), the following command (without sudo) will install python-imaging
apt-get install python-imaging
You should ideally be using a virtualenv and pip install pil there... If you have access and want to use system wide packages, then you need to elevate to root (sudo) to easy_install or pip install.
Make sure your server (Django?) is rebooted so it can pick up the new libraries. (The interpreter doesn't always seem to pick up newly installed modules while it's running).

Categories

Resources