Install python modules in cygwin

22,044

Solution 1

On windows, under cygwin follow the below steps.

1.Ensure python is installed in cygwin. Type python on the terminal of cygwin and it should launch the python shell. If it doesn't launch the setup file for cygwin and select python from the package list and install. 2. Now, install pip if it's not already installed. Provide full path if you have multiple python installations e.g.

/usr/bin/python2.7 -m ensurepip
/usr/bin/python3.6 -m ensurepip

3. Now, you can use pip to install the python package. Depending upon the installation in which you want the package to be installed, run below command(s)

/usr/bin/python2.7 -m pip install pyyaml
/usr/bin/python3.6 -m pip install pyyaml

Solution 2

In standard python installation, pip like scripts goes under "your_python_directory\Scripts". (in my system C:\Python34\Scripts) Make sure you have added this path to system directories (Environment Variables). Then

pip.exe install my_package_name

will work fine.

Also for configuring within cygwin this will help.

PS: sorry for confusion though I thought you meant you have installed python separately from cygwin. I believe this thread answers your question.

Share:
22,044
Zack
Author by

Zack

hello world!

Updated on August 31, 2020

Comments

  • Zack
    Zack over 3 years

    What is a way to instaill python modules within cygwin? I'm new to cygwin and couldn't find pip or anything like that in the setup.exe package. I've looked around and I can't find a definitive way to do it. Does anyone have advice?