How does Python work on Cygwin? - python-2.7

I installed Python 2.7.9 from (https://www.python.org/downloads/windows/), and then Cygwin 2.8.59. But I had problems when installing numpy.
pip install numpy
error: Unable to find vcvarsall.bat
So I uninstalled python using set-x86.exe (Cygwin installer). Now my commands python and pip are these:
$ which python
/cygdrive/c/Python27/python
$ which pip
/cygdrive/c/Python27/Scripts/pip
I could installed numpy using pip, and execute files by "python test.py". I, however, cannot use interactive console. If I type
$python
the console freezes and I cannot do anything other than Ctrl+C.
How should I do to use the command, "python"?

Try
cygstart /cygdrive/c/Python27/python.exe
According to this question: Using Windows Python from Cygwin
cygwin is just going to hang because windows doesn't think that the cygwin command 'Python' means interactive console, and will not flush the buffer as if it were an interactive console.

Related

Installing tensorflow on virtualbox ubuntu 20.04 python 2.7 - 'Illegal instruction (core dumped)'

my goal is to follow this guide so that I can convert a Caffe model to a Tensorflow model. As my original OS is Windows 10 I am using the virtual Ubuntu 20.04 (using Oracle VirtualBox) with python 2.7 and anaconda virtual env. I am able to successfully install tensorflow for python 2.7, but when I run the command python -c 'import tensorflow', I get an error with text Illegal instruction (core dumped). I have tried to google to get more information but all I got was that it maybe has something to do with the architecture, I found out that my architecture (on the virtual ubuntu) is x86_64. That is all I have found out and now I turned to SO to ask what I should do to be able to run tensorflow in the before described environment, many thanks beforehand.
For those wondering, the pip or conda installation did not work in my case, so I followed the instructions on this guide for linux, python 2.7 using the pip installation method with a tensorflow version of 0.10, which for my purposes is good enough.
Exact steps in case the link does not work in the future:
$ conda create -n tensorflow python=2.7
$ conda activate tensorflow
Your prompt should change to this: (tensorflow)$
(tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.10.0-cp27-none-linux_x86_64.whl
(tensorflow)$ pip install --ignore-installed --upgrade $TF_BINARY_URL
This is, as outlined, for python 2.7, but the guide contains info for newer versions as well. To check whether tensorflow installed correctly you can run this command $ python -c 'import tensorflow as tf; print(tf.__version__)' which should output 0.10.0.

In Windows 10, pip import error: cannot import name main after installing pipenv

I am trying to use pipenv as well as pip and having some issues. I installed pipenv using pip. I installed pipenv using pip. Then I went back and tried to run pip -v and got the following: ImportError: cannot import name main. I have seen this question answered for Linux and Mac, but I cannot use sudo or which commands; I am on Windows 10 using the CMD console. In my scripts folder, I see pip, pip2.7, and pip2. I cannot remember which one was my system pip. I know I need to maybe uninstall and reinstall (I have already tried to upgrade, but of course, without pip running you can't upgrade pip). I don't want to make more of a mess, so I wanted to ask how to resolve this in the CMD console on Windows.
Apparently, when I installed pipenv, it changed the system pip version that I was previously using. For some reason, all of the answers I found were using Linux or Mac, but here is how I resolved it. Simply open your command prompt and type:
$python -m pip uninstall pip
Then, test that you still have your old version installed by typing:
$pip -V
This showed me that I had gone from using pip version 18 back to using version 8.1.1. You should then be able to proceed to other tasks using pip.

C:\Windows\system32>pip install pandasFatal error in launcher: Unable to create process using '"'

I have recently installed python-2.7.14 (32-bit) on windows 10. But when I try to install any package using command pip install XXX, it gives me above error.
I tried all solution to this existing problem but it didn't work for me.
My python is installed on C:\Python27
python -m pip install XXX
worked for me but when I tried to open jupyter notebook in windows command prompt by typing
jupyter notebook
It used to give me the same Fatal error.
Actually, it was my antivirus mcafee at organisational level which was blocking the exe to run.
To solve this I had installed python in D:\ folder.

Can't open a Python interpreter in Spyder 2.2.5 (Ubuntu 14.04)

A few weeks ago, I opened Spyder and found that I could not interact with the default Python interpreter console, which appeared greyed-out (screenshot below).
Consequently, I am not able to run Python scripts from within the IDE. I have tried rebooting my machine, opening new interpreters and IPython interpreters, but the result is always the same. I recently tried running spyder --reset in the terminal to erase my settings, but it did not help.
The only recent changes to my Python installation I made were in a virtualenv where I installed Python3, but I am not convinced this is related.
I had the same issue, also after updating packages. I solved the problem by updating Spyder:
sudo pip install --upgrade spyder

Bad Interpreter: No such file or directory error when launching iPython with Anaconda

My ipython was working fine until I installed a new IDE and accidentally changed some path settings. Now, when I try to launch ipython from terminal I get:
-bash: /Users/JohnSmith/anaconda/bin/ipython: /Users/JohnSmith/anaconda/python.app/Contents/MacOS/python: bad interpreter: No such file or directory
How do I change my path/local environment settings back so that it works?
It seems that uninstalling and re-installing Anaconda was the easiest solution (after several hours of playing around with my PATH variables, etc).
This github thread shows the solution from spyder dev ccordoba12:
https://github.com/spyder-ide/spyder/issues/9951#issuecomment-517913824
run
conda install -f python.app
(Very fast to run)
Then spyder etc. was fixed. Apparently an incorrect python path in the launch script.
FYI I had this same issue with Anaconda install with python 3.8 (2022), after a big mess with upgrading anaconda via conda update --all. On MacBook Pro (Intel)