install tensorflow on cygwin error - python

I am new to linux and try to install tensorflow on cygwin on a windows 7 machine with only CPU following this instruction.
I tried to install with native pip however encountered some errors when running this command:
pip3 install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.2.1-cp36-cp36m-linux_x86_64.whl
(I omitted sudo since there's no sudo on my cygwin). The error message is:
tensorflow-1.2.1-cp36-cp36m-linux_x86_64.whl is not a supported wheel on this platform.
The python 3 on my cygwin is 3.6.1, pip3 version is 9.0.1.
Here are some basic command result:
$ python3 -V
Python 3.6.1
$ whereis python3
python3: /usr/bin/python3 /usr/bin/python3.6 /usr/lib/python3.6 /usr/include/python3.6m /usr/share/man/man1/python3.1.gz
$ pip3 -V
pip 9.0.1 from /usr/lib/python3.6/site-packages (python 3.6)
$ echo $PATH
/usr/local/bin:/usr/bin:/cygdrive/c/Program Files (x86)/ActiveState Komodo Edit 10:/cygdrive/c/ProgramData/Oracle/Java/javapath:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/Wbem:/cygdrive/c/WINDOWS/System32/WindowsPowerShell/v1.0:/cygdrive/c/Program Files (x86)/Microsoft Application Virtualization Client:/cygdrive/c/WINDOWS/System32/WindowsPowerShell/v1.0:/cygdrive/c/Program Files (x86)/Pandoc:/cygdrive/c/Program Files/MiKTeX 2.9/miktex/bin/x64:/cygdrive/c/WINDOWS/System32/WindowsPowerShell/v1.0:/cygdrive/c/Program Files (x86)/PuTTY:/cygdrive/c/Program Files (x86)/Skype/Phone:/cygdrive/c/Program Files/1E/NomadBranch:/cygdrive/c/Users/jinhuwang/AppData/Local/rodeo/app-2.5.2/bin
I've seem many related question on stackoverflow but got no luck to find the solution to mine. Could anyone help?

From cygwin's frontpage:
Cygwin is not:
a way to run native Linux apps on Windows. You must rebuild your application from source if you want it to run on Windows.

Related

Python packages on Rosetta M1 Macbook

I am trying to run a script from a repo which was using python 3.7 and other packages version that were not supported in M1.
I install a separate conda through open terminal under Rosetta, i can install those specific packages i need. but when i try to run some sample scripts (repo comes with some pytest example) i always got error of Python Segmentation Fault.
Any clue/direction on how to solve this, or this is not solvable.
Or any detail might be helpful to understand the situation.
Thanks.
I don't know if it's solvable, but I think I'm running into the same issue.
For reasons (ortools package not supporting M1) I need to run Python under Rosetta 2, the following used to work, but now segfaults:
# Install Homebrew with Rosetta 2 / Intel
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
# Install Python 3.8 using 'Intel' Homebrew
arch -x86_64 /usr/local/bin/brew install python#3.8
Then in my project directory, I setup a venv:
arch -x86_64 /usr/local/bin/python3.8 -m venv venv
. ./venv/bin/activate
# Install requirements (including pytest)
arch -x86_64 pip install -r requirements-dev.txt
Then I get a segfault, regardless of if I run pytest under Rosetta or not:
(venv) me#host myproject % pytest
zsh: segmentation fault pytest
(venv) me#host myproject % arch -x86_64 pytest test/unit_tests
zsh: segmentation fault arch -x86_64 pytest test/unit_tests

virtualenv is not picking python3 automatically from /usr/bin

I have installed new ubuntu 18.4 and while solving some other error while installing requirements through pip. I tried installing python-setuptools and python-dev instead of installing python3-setuptools and python3-dev which in turn installed python2.7 on my machine. Well the solution didn't work and I removed the packages as I don't want 2.7 on my machine and now when I run the following command:
sudo virtualenv venv
I get this message: The path python2 (from --python=python2) does not exist.
before installing python-dev and python-setup tools the above command worked fine.
I have tried replacing python symbolic link to python3.6 in /usr/bin.
by executing: ln -s /usr/bin/python3.6 /usr/bin/python although I am able to get python3.6 console every time run python like on fresh install of ubuntu but I can't creat virtual environment the same way.
Try yo run it with this specific python
/usr/bin/python3.6 -m pip install virtualenv
sudo /usr/bin/python3.6 -m virtualenv venv
and delete the python2.7 is probably a bad idea cause there is probably thing that using it on your machine, and also, consider reading about system envirmate varibles, as PATH for example that would solve you problem

How to install pip associated to different versions of Python

Currently, I am running two versions of python on Mac. The native one (2.7.10) (/usr/bin/python), and another one, which has been downloaded via home-brew (2.7.14).
I want to download two versions of pip and download packages depending on the python version I want to use.
Is this possible?
Start by checking your available Python interpreters on your command line:
[root#server ~]# ls /usr/bin/ | grep python
python2 -> python2.6
python2.6
python3 -> python3.4
python3.4
Then download and run this file using each interpreter
[root#server ~]# python2.6 get-pip.py
[root#server ~]# python3.4 get-pip.py
Then once both Python interpreters have thepip module installed, you can install packages to your specific Python interpreters using the following commands:
[root#server ~]# python2.6 -m pip install <module>
[root#server ~]# python3.4 -m pip install <module>
It's worth mentioning (for Windows Users), once you have multiple versions of Python installed, you can easily manage packages for each specific version by calling pip<major>.<minor> from a cmd window.
for example, I have Python 2.7, 3.6 and 3.7 currently installed, and I can manage my packages for each installation using pip2.7, pip3.6 and pip3.7 respectively ...
On Windows 10, $ pip3.7 install <module> works for me - haven't tested it with venv instances yet though

Cannot install pip on Python 2.7

I'm a new Python user. I'm having issues installing new modules for python 2.7. When I try installing a new module from PyCharm, I get the following error
Error: Python packaging tool 'pip' not found
Moreover, I'm a bit confuse about which Python version I'm actually using...
This is what I get when I type the following commands in the terminal.
$ which python
/usr/bin/python
$ echo $PYTHONPATH
PYTHONPATH:/usr/local/lib/python3/dist-packages/
$ python -V
Python 2.7.6
Everything seems a bit messed up to me...all the procedures I follow to install pip result in failure. The command
$ python get-pip.py
returns
You are using pip version 7.1.0, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command
However, when I run that command, it tells me that there is no module named pip.
Please, how can I fix it? I need to work with Python 2.7 but I'm completely unable to install packages. Thanks.
EDIT I am using Ubuntu 14.04 LTS
You may be trying to install pip wrong. Depending on your version of linux there are several install methods that can be found here
for your version judging by your use of get.
try this one:
sudo apt-get install python-pip

Ubuntu Python "No module named paramiko"

So I'm trying to use Paramiko on Ubuntu with Python 2.7, but import paramiko causes this error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named paramiko
The other questions on this site don't help me since I'm new to Ubuntu.
Here are some important commands that I ran to check stuff:
sudo pip install paramiko
pip install paramiko
sudo apt-get install python-paramiko
Paramiko did "install". These are the only commands I used to "install" paramiko. I'm new to Ubuntu, so if I need to run more commands, lay them on me.
which python
/usr/local/bin/python
python -c "from pprint import pprint; import sys; pprint(sys.path);"
['',
'/usr/local/lib/python27.zip',
'/usr/local/lib/python2.7',
'/usr/local/lib/python2.7/plat-linux2',
'/usr/local/lib/python2.7/lib-tk',
'/usr/local/lib/python2.7/lib-old',
'/usr/local/lib/python2.7/lib-dynload',
'/usr/local/lib/python2.7/site-packages']
In the python interpreter, I ran help("modules") and Paramiko is not in the list.
two paramiko folders are located in usr/local/lib/python2.7/dist-packages.
Short version: You're mixing Ubuntu's packaged version of Python (/usr/bin/python) and a locally built and installed version (/usr/local/bin/python).
Long version:
You used apt-get install python-paramiko to install Ubuntu's official Paramiko package to /usr/lib/python2.7/dist-packages.
You used (I assume) Ubuntu's version of pip, which installs to /usr/local/lib/python2.7/dist-packages. (See here.)
You used a locally built version of Python, and because it's locally built, it uses /usr/local/lib/python2.7 instead of /usr/lib/python2.7, and because it doesn't have Debian/Ubuntu customizations, it doesn't check use dist-packages.
Solution: You should be able to add /usr/local/lib/python2.7/dist-packages to your /usr/local/bin/python's sys.path, but since you're using Ubuntu, it's easiest to let Ubuntu do the work for you:
Use /usr/bin/python instead of a local version.
Use Ubuntu's packages wherever possible (i.e., use apt-get instead of pip).
Use virtualenv for the rest (to keep a clean separation between Ubuntu-packaged and personally installed modules).
I'd go so far as to uninstall the local version of Python and delete /usr/local/lib/python2.7, to ensure that no further mismatches occur. If you don't want to be that drastic, then you can edit your $PATH to put /usr/bin before /usr/local/bin to run the system version of Python by default.
Try downloading the zip file from https://github.com/paramiko/paramiko and running this command in the unzipped directory :
python setup.py install
There are two others methodes for add modules in python :
The first :
Download the package.
Create directory and paste the package in it.
Tap in the terminal :
export PYTHONPATH=$PYTHONPATH:path_of_package
The second :
open python interpreter:
import sys
sys.path.insert(0, "path_of_package")
Try installing only through commands.
Download paramiko package from git using this command: git clone https://github.com/paramiko/paramiko.git
Go to unzipped directory and run export PYTHONPATH=$PYTHONPATH:<path_to_paramiko>
If you find libffi package not found then run this command: sudo apt-get install libffi6 libffi-dev and If you haven't properly installed the header files and static libraries for python dev then run this command: sudo apt-get install python-dev
Enjoy :)
Also, mind the version of python, if the error was reported by python3, then install python3's paramiko.
If you're using Python 3, type the below command
$ sudo -H pip3 install paramiko --ignore-installed
try type pi then tap, this give you this
:$ pi
pic piconv pidstat pinentry-curses ping6
pip3 pivot_root
pic2graph pidof pinentry ping pinky
pip3.6
then you type in whereis pip3
$ whereis pip3
pip3: /usr/local/bin/pip3.6 /usr/local/bin/pip3
xg#xx-ppmaster:/xg/scripts/pyth
$ sudo /usr/local/bin/pip3 install paramiko
This should let you install paramiko
more on python installation
https://danieleriksson.net/2017/02/08/how-to-install-latest-python-on-centos/

Categories

Resources