Conda - installing tensorflow from a .whl file behind a firewall - python

I have got an Anaconda3 with Python 3.6 (Spyder) environments, trying to install tensorflow, however, can't utilize the standard pip installation due to company firewall.
Furthermore, I can't create an anaconda environment for the same reason. What I am trying to do is to install tensorflow directly from the whl file (which I have downloaded from the official website), using the following command:
C:\Users\me>pip install --no-deps tensorflow-1.8.0-cps36-cp36m-win_amd64.whl
which leads to 'Requirement _ looks like a filename but the file does not exist' -> _ is not supported wheel on this platform.
When I try to run via:
conda install --no-deps tensorflow-1.8.0-cps36-cp36m-win_amd64.whl
I get Solving environment: failed, CondaHTTPError: ... etc. - probably due to the same firewall reason.
Now, is there any way to install the .whl without encountering the firewall restrictions?
Thank you vm guys.

I had some success with this in my company (which also doesn't allow internet access by Anaconda package manager)
I found this site:
https://www.lfd.uci.edu/~gohlke/pythonlibs/
where you can download wheel files for a number of python packages. You can then use PIP to install the wheel packages locally .
pip install some-package.whl
as detailed in this answer

Related

How to get .whl file, if a library is already installed?

I have a python library installed on my pc. I did it with pip install. Is it possible to create .whl file of that library with Python code?
I need it, because i don't have access to internet on that pc currently.
If I were you I would try some variant of python -m pip wheel --no-index --no-deps NameOfLibrary.
Otherwise maybe the wheel is already in one of pip's caches (build cache or download cache). You can find their location with python -m pip cache info and go from there.

Install python packages offline on server

I want to install some packages on the server which does not access to internet. so I have to take packages and send them to the server. But I do not know how can I install them.
Download all the packages you need and send them to the server where you need to install them. It doesn't matter if they have *whl or *tar.gz extension. Then install them one by one using pip:
pip install path/to/package
or:
python -m pip install path/to/package
The second option is useful if you have multiple interpreters on the server (e.g. python2 and python3 or multiple versions of either of them). In such case replace python with the one you want to use, e.g:
python3 -m pip install path/to/package
If you have a lot of packages, you can list them in a requirement file as you would normally do when you have access to the internet. Then instead of putting the names of the packages into the file, put the paths to the packages (one path per line). When you have the file, install all packages by typing:
python -m pip install -r requirements.txt
In the requirements file you can also mix between different types of the packages (*whl and *tar.gz). The only thing to take care about is to download the correct versions of the packages you need for the platform you have (64bit packages for 64bit platform etc.).
You can find more information regarding pip install in its documentation.
You can either download the packages from the website and run python setup.py install. Or you can run a pip install on a local dir, such as :
pip install path/to/tar/ball
https://pip.pypa.io/en/stable/reference/pip_install/#usage
Download the wheel packages from https://www.lfd.uci.edu/~gohlke/pythonlibs/ . You may install the .whl packages by pip install (package.whl) , refer installing wheels using pip for more.
Download the package from website and extract the tar ball.
run python setup.py install

Installing fix_yahoo_finance without pip in Anaconda

I am learning Python and use Anaconda navigator 1.8.7 and Spyder 3.3.0 (Python 3.6.6 32 bits, QT 5.9.4, PyQt5 5.9.2 on Windows). I would like to install a package called 'fix_yahoo_finance' without using pip since I have read that pip creates problems for Anaconda users.
I know that this is the line of code used when using pip:
pip install fix_yahoo_finance --upgrade --no-cache-dir
When I tried using
conda install fix_yahoo_finance
and I get a 'Solving environment: failed'
How do I get this package without using pip? Is there an alternative way that I could run this package in Anaconda like placing it in the pkgs folder?? I am absolutely confused and would really appreciate your help on this.
Thanks a lot in advance.
You can actually install it from other way around as well, clone this repo into your local system.
git clone https://github.com/ranaroussi/fix-yahoo-finance.git
Then go to the directory fix-yahoo-finance or any dir that you have cloned the repo. Then run sudo python3 setup.py install
This way too you can install the package without using pip, but make sure your python is pointing to the Anaconda's python, otherwise the only way to install it would be to copy the package folder from the site-pacakges and paste inside the Conda's package folder. Also you can look around your conda install error, https://github.com/conda/conda/issues/6390

pip without SSL certificate checking?

is there an older version of pip that doesn't check SSL certificates?
my corporate proxy replaces the cert from pypi with a company one which causes pip to abort the install.
I can download the packages manually and use pip on the local .tar.gz files but that is just a pain particularly with complex dependencies.
Version 1.2.1 works great for me as I'm always behind a corporate proxy.
https://pypi.python.org/pypi/pip/1.2.1
I'm not sure of your situation, but I also had to install it on a shared VM so I built and installed it to my user directory (~/.local/)
python setup.py build
python setup.py install --user
Update your path (~/.bashrc)
export PATH=~/.local/bin:$PATH
Then install packages (fabric example)
pip install fabric --user

Why does pip fail when installing local egg repository?

I am working on Windows 7.I have created a python egg using distutils. Now I try to install this egg in a virtual environment using pip 1.0.2 using the following command:
Then I create a virtual environment myVirtualEnv I activate it using activate.bat then execute the following command:
pip install path_to_my_local_folder#eggName
This creates a copy of my egg in my myVirtualEnv\build directory but I have the following error:
IOError: [Errno 2] No such file or directory: path_of_my_virtualEnv\build\PyEqdR\setup.py
Do you know why pip is looking for the setup.py file. Should I include it in the egg ?
http://www.pip-installer.org/en/latest/other-tools.html#pip-compared-to-easy-install
pip doesn’t do everything that easy_install does. Specifically:
It cannot install from eggs. It only installs from source.
I just came across this page and since I had the same exact problem, I thought to post the solution that worked for me.
This is an issue with the older versions of pip. My version of pip was 1.5.4. I was not able to find the first version of pip that was able to do it but the current version 6.0.6 does the job.
To update to latest pip version, simply run the following command:
pip install --upgrade pip
Needless to say if you want this to only take effect inside your virtual environment, run it inside the environment. Otherwise, run it globally.

Categories

Resources