Pip install python modules easy - python

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.

Related

Cannot uninstall 'numpy'

I've been trying to install astropy and at the end of the installation I get this message:
Cannot uninstall 'numpy'. It is a distutils installed project and thus
we cannot accurately determine which files belong to it which would
lead to only a partial uninstall.
I have tried: pip uninstall numpy and then I get the same message.
I have Python 2.7.10 in a macOS High Sierra version 13.10.5
This doesn't directly answer your question, but that's because you're asking the wrong question.
Astropy requires Python 3.5 or 3.6. Trying to get it working with Apple's pre-installed Python 2.7 is a waste of time. You might be able to get an old version working this way, but not by using the installation instructions on astropy.org, and it won't be supported even if you do.
The easy solution is to just Install the latest Anaconda 5.x with Python 3.6, because it comes with Astropy built in.
The almost-as-easy solution is to install Python 3.6 from either a python.org binary installer, or Homebrew, and then use pip3 or, better, python3 -m pip to install everything, as explained on the Astropy install page.
Either way, before doing anything else, you want to get back to a clean slate. In particular, you do not want pip, or any other scripts, attached to Apple's Python 2.7; they will only cause confusion. Assuming you can't reinstall macOS from scratch, the best way to do this is:
Look in /Library/Python/2.7/site-packages and delete everything there except for README and Extras.pth.
Look in /usr/local/bin for symlinks to anything in that site-packages. (If you don't know much about using Unix, try this command: ls -l /usr/local/bin | grep 2.7.) You'll probably have pip and pip2.7 here, and probably nothing else. But whatever you have here, delete it.
Now, when you install Python 3.6, the only thing named pip anywhere will be that Python 3.6's pip. You still want to use pip3 or python3 -m pip, but if you screw up and type pip by accident, it won't break anything.
Also, you should strongly consider using a virtual environment. See the Python Packaging Authority's User Guide (or the Anaconda docs, if you went that way) for more on this.
One simple solution I found:
sudo -H pip install astropy --ignore-installed numpy
I also had this issue and couldn't get around it in a clean way, but this is what I did:
Inside the Lib folder search "numpy" for an egg_info file (eg. numpy-1.11.0.dev0_2329eae.egg-info).
In my case, this is what Pip was looking at to determine if a current version already exists. I deleted it, then ran normal
pip install numpy
and installed the newest version.
I don't recommend this because I don't understand what it's doing under the hood and it doesn't properly uninstall the old version which could be a recipe for trouble down the line, but if you're desperate like I was then maybe this is a solution for you.

How do I install packages/modules for Python 3.6?

I'm super new to Python, and can't figure out how to install packages or modules. I know you can use Pip to easily install them, but none of the commands I've found have done anything but give me errors. Any help would be appreciated.
Have you tried pip install? A good thing to remember is pip usually requires sudo on linux distributions. Also, for some modules it's easier to use conda, since it takes care of dependencies. It this is the best general information I can give. If you told me some packages you've tried to install, that would help a lot!

Installing numpy/matplotlib/etc. on Mac

I am very new to python, and am having difficulty getting any packages from online to install properly. I'm pretty sure I'm doing something fundamentally wrong, but since I am new to language I am unsure of what it is. I have read through several online sources but still can't get it to work. I feel really dumb asking this, but I would greatly appreciate it if someone could walk me through how to install it starting from the point of downloading the package online. Thanks!
If your primary use case is the scipy stack, for example as a Matlab replacement. I would highly recommend using the Anaconda distribution. It is brilliant for new comers, a large majority of what you are likely after comes pre installed.
Download it here:
https://www.continuum.io/downloads#_macosx
I would recommend picking the python 3 64bit installer. A direct link to the download is here:
https://3230d63b5fc54e62148e-c95ac804525aac4b6dba79b00b39d1d3.ssl.cf1.rackcdn.com/Anaconda3-2.3.0-MacOSX-x86_64.pkg
Your best bet is to use Homebrew as your general package manager and then use use it to install Pip to manage all of your python packages. Both of the links below will walk you through how to do these things.
See Homebrew link
See How to install pip on Mac for Pip
Go here and download get-pip.py
Then, from terminal run the command python get-pip.py
This should install pip for you. Pip is awesome, and you really want to have it. Now, all you have to do is run this command from terminal:
pip install matplotlib
Or to get Numpy:
pip install numpy

Trouble installing "distribute": NameError: name 'sys_platform' is not defined

I'm trying to install the Python package "distribute". I've got it downloaded and it begins to work, but then quits out with the error seen here:
I have a feeling the solution is somehow related to me going in and defining sys_platform, but I don't have enough of a grasp on what's actually wrong to know what to fix. Thanks for any help! I'm always blown away at how helpful you all are.
As stated by Burhan you have to install the setuptools package: just use the command:
pip install setuptools
Most importantly, do not forget to also uninstall the distribute package (since tools provided by that package are already included by setuptools).
Just use the command:
pip uninstall distribute
You need to install setuptools; as distribute is now a part of it.

Install PRAW with MacPorts Python

Question
How can I install PRAW with a MacPorts version of python?
It seems like there is no port for it.
What I tried
The closest thing I've found to this question is: MacPorts manual port location, so I mucked around with trying to make my own port for it, but I really don't know what I'm doing.
I know that I could install it with pip for a non-MacPorts version of Python.
This is no need for a platform-specific version of PRAW. Using pip or easy_install is the recommended way to get the most up-to-date python packages as PyPI, the Python Package Index, is to python packages what MacPorts, (or Brew, Fink, etc), is to OSX-specific packages.
As the PRAW package maintainer, I would prefer that you do not create platform-specific packages, simply because they are unnecessary and more importantly because they become out-of-date very quickly.
If you are worried about cluttering the namespace of your system's python, then I suggest you use virtualenv, or the built-in virtual environment features if you are using python 3.3.
So it turns out that I'm an idiot who didn't understand that macports could install its own version of pip as well. Here's how I finally got PRAW working:
sudo port install py27-pip
sudo pip-2.7 install praw
I really need to get this virtualenv thing figured out...

Categories

Resources