Installing matplotlib and numpy without pip - python

I'm running python 3.7 and idle.
I can't use pip because of the firewall at work (I think).
I tried following these instructions:
How to manually install a pypi module without pip/easy_install?
When I try to install matplotlib it looks for numpy, so I assume it's a prerequisite. numpy looks for VS c++ 14.0, so I assume that is also a prerequisite. Are my assumptions right?
Installing VS may be a pain due to hard drive space. I want to make sure I don't do it for nothing.
When I download and unzip the installation folders where is a good place to save them to make life easier? I have a 'python37' folder in c drive and I created a new folder there. Is there somewhere better for referencing?
Please be as explicit as possible in your answers, all of this is new to me.

If you have ability to download and install on your computer, I would recommend just installing/using the Anaconda distribution of Python, which has almost everything you need rolled in (including matplotlib and numpy) with the basics.
https://www.anaconda.com

Turns out the work around is to set a proxy in . I have no idea where the proxy came from and why and how it works but it worked.
I'd still be interested to get answers to my questions though, as someone else might be having similar issues or needing to install downloaded modules on machines which aren't connected to the internet (the latter being very likely for me in the near future).
So to be clear I'm not asking what distribution to use or for other locations to download wheels files. I need to know how to install without using pip on a machine which is not connected to the internet.

apt install python3-numpy
i Guess this will work

Try downloading the packages from https://www.lfd.uci.edu/~gohlke/pythonlibs/ and install them using
pip install name_package.whl

Related

Python: Installing PIP via NTLM from embedded ZIP file

So I have downloaded the "Windows x86-64 embeddable zip file" from https://www.python.org/ftp/python/3.7.4/python-3.7.4-embed-amd64.zip and it works well
I want to install PIP so I also got https://bootstrap.pypa.io/get-pip.py
However it's throwing up a 407 proxy authentication error and despite me putting proxy information in, I presume at this point that NTLM is to blame.
My question is how would I get around this? Is it possible to install PIP/Setuptools via the embeddable zip method 100% offline?
I want to eventually use pandas and requests
I tried what pip with embedded python suggests but get the below:
Thanks
It might be complicated but probably not impossible. Also I haven't tested any of this personally, these are more directions that you could look into.
First I would have a look at this. The important point is to find your python??._pth file and uncomment the import site line.
But you say get-pip.py did not work, right? (from here)
python get-pip.py --proxy="http://[user:passwd#]proxy.server:port"
So you could download the wheels another way and then try something like this to bypass the network issues
(from here):
python pip-10.0.1-py2.py3-none-any.whl/pip install --no-index pip-10.0.1-py2.py3-none-any.whl
Once you have pip running you can slowly build a Python environment that is comfortable enough to work with. But I believe you would still be severely limited, I think parts of the standard library will be missing and so on.
Maybe you should work on solving the issues preventing you from getting a standard Python installation instead.

pip.exe has stopped working

I know this question has been asked a few times before, but none of the answers I've read have managed to solve my problem.
When I try to run any of the following, I get an error saying "pip.exe has stopped working:
easy_install
pip
pip3
It was working for me previously (the last time I used it was probably a month ago), but not anymore. I'm using Python 3.4.4, I checked the PATH and it's configured correctly. Does anyone know what else might be causing the issue?
I had the same problem before and the solution is quite simple.
First try updating pip via command:
pip install --upgrade pip
If that doesn't work try uninstalling current version of python and reinstalling the newest version.
Note1: Do not just delete install files and files in your C drive ,uninstall everything packages, everything that might cause problems, especially delete old python packages and extensions they might not work with the newest python version and that might be the problem. You can see in python website which packages and extensions are supported.
Note2: Do not and I repeat DO NOT install .msi or .exe extensions they don't work anymore always use .whl (wheel) files. If you have one .msi or .exe uninstall them form your system completely; that also means that you have to uninstall them from command prompt.
Note3: Always check if the .whl is compatible with your Python version.
Note4: Also don't forget to save your projects before doing anything.
Hope that works :D
Happy Coding.

Why Should Homebrew be used to Install Python?

I have been reading a lot of the tutorials around the web and answers on the site about using Homebrew. When it comes to Python though, the advice leaves me with more questions than answers.
I understand the how, but none of the answers I have seen so far have really explained the why behind using Homebrew to install Python and what the benefits are to installing Python with Homebrew as opposed to using OS-X installers provided by the Python Foundation?
The newest versions of the installers from Python and the current implementation of PIP seem to be working pretty well, so I would really appreciate any input on my question. I have worked with Python for a while but from more of a tactical, one off problem solving perspective and I am brand new to tools like Brew and version control software such as Git. I am trying to get up the learning curve. Finding an answer to why I would choose to go with a Homebrew install over just heading over to python.org and downloading from them and then using pip to install packages might help me to understand the benefits of a tool like Homebrew.
So I guess, what does Homebrew give me that going through the installation put in place by TPF does not?
Are there advantages/disadvantages to where Homebrew installs Python and Python packages over the /Library/Frameworks/ and the site-packages folder within that framework?
Though this last question is too broad and likely out of scope, if anyone would also address or provide a link to a good answer on what the benefits are of using Homebrew in general, I'd appreciate it?
Thank you,
The big advantage of using a package manager like Homebrew is it makes it easier to keep your Python installation up to date. If you download Python from the website, then to update it means you'll need to go back to the website and download a new copy of Python (or whatever it is that you need to update that could have been installed with Homebrew).
Also, when downloading installers, I find they tend to clutter up my downloads folder and require me to periodically clean up unused files. I'd rather spend my time coding instead of managing my disk space usage.
When it comes to updating any package with Homebrew, the command is simple:
brew upgrade
And this will update all outdated packages that you installed with Brew.
Now, this isn't something unique to Homebrew. Macports, PIP, npm, Maven, and other package management tools are also able to manage the versions of modules or tools you install.
For more information, see Safari Books Online - Keeping Your Homebrew Up To Date.
A few reasons not to use system python on OS X from this post,
Apple doesn’t always do a good job on keeping the Python runtime environment up to date,
it can be cumbersome to play with permissions just to install third-party Python libraries,
finally, Apple has a tendency to wipe-out your site-packages with every major OS upgrade.
The use of an independent package manager for Python modules, such as Homebrew, conda, Macports, ets. is thus preferred.

Is there a more efficient way to satisfy project dependencies than pip?

I work on a system and the hosting guys don't want to use an install script that uses pip. Now we have a large pip requirements file that install the dependencies. Is there any other way to do it than using pip? Can it be done using yum or apt-get ? We are using Linux.
For god's sake, please do not fall back to using the distribution's package manager just because your hosting guys do not understand what pip+virtualenv is good for.
Python packages in Linux distribution repositories are often outdated and may come with quirks that other Python package authors did not plan for. This is especially true for Python packages with compiled code. If a documentation tells you that a certain dependency should be obtained directly from PyPI via pip, then you better follow that requirement. Convince your hosting guys to use the right tools, namely pip combined with virtualenv. The latter will create an isolated environment and make sure that the system will stay clean (really, nobody needs to do a sudo pip install, which probably is the thing your hosting guys are afraid of).

Installing rpy or rpy2 on mac

I'm in the process of trying to install rpy or rpy2 on my Macbook so I can use R from python. Information about rpy can be found here: http://rpy.sourceforge.net/index.html
My problem is in the installation itself. I can't seem to make python recognize Rpy using import command: I keep getting the message "No module named rpy2". Does anyone know where I can find some step-by-step instructions on how to successfully install this? I have already installed both python and R, and both are working perfectly. Thanks in advance!
Try easy_install rpy2. You need to install easy_install before that.
I took that from here
I long gave up on these issues on my Mac. Since I installed OS Lion, I found that I needed to switch to MacPorts and then installing packages like RPy2 from their repository.
I know some people like to dig into the system and learn all the idiosyncrasies of the architecture and keep a vanilla install of python on their Mac. I find that i get problems like yours too frequently and they distract me from real work.
I just download the MacPorts modules when I need them and get on with the problem at hand. Others say the same thing about HomeBrew but I have only worked with MacPorts and it makes installation of modules too easy. You may want to invest some time investigating if either of these solutions work for you.
Another approach to using package managers like MacPorts or HomeBrew is to use a virtualenv and install python and all related modules there. Again, not a solution I have tried directly, but a quick search will show you many endorsements for this approach to using a specific Python executable and packaging its modules In an isolated environment.
as long as you have pip installed on your mac, then life will be easy as:
sudo pip install rpy2
If you want rpy it isn't on macport, at least a search of their packages only showed rpy2. According to the rpy web site its in fink. However at the moment fink is down so I can't verify this. Which is irritating because I need rpy (not rpy2) because another package has a dependency on it.
I also tried pip to find rpy and it said no package, which is a shame because pip is great for python installs (provided I remember to use 'sudo' first.

Categories