Where to Install Python Package from Source for Virtual Environment - python

When trying to install pycURL using pip on Windows, I kept running into errors, so I decided to try to install it from the source on github. I'm using a virtual environment through anaconda3, and I'm wondering which folder/directory I need to clone into in order to get the installation to work?
Here's a photo of the virtual environment's directory.

Related

pip installing package in weird location

I'm trying to install imgui with pip with anaconda3 All of my packages are in anaconda3\Lib\site-packages but when I install imgui, it installs it in another folder on C:\Python39
Which location should I keep imgui in?
If you are installing with pip, it seems like you are installing the package from the main python installation, instead of using the virtual environment. Be sure to have your virtual environment selected when launching the command. You could usually check that if at the beginning of the line in your terminal you have the name of the virtual environment between brackets, like (anaconda3) C:\Users\...

Python - where are Libraries stored in virtual environments?

I created a new VENV and pip installed awscli there.
I can see it installed with pip list --local.
But when I type aws - it does not recognize the command (even though I activated that VENV).
How to setup paths so that newly installed library in VENV can be recognized?
There are many ways to create a virtual environment. Let's say:
python3 -m venv my_venv
But to install some package in that particular environment, you have to activate it by:
For windows:
my_venv\Scripts\activate
For Linux or Mac:
source my_venv/bin/activate
Then if you install a package by using pip, it will be installed in that particular virtual environment. Otherwise, it will be installed in the local environment.

Python virtual environment not working

I have activated the python virtual environment, but anyway when I run pip install *, the dependencies are installed to my local Python path. The same happens when I run the server in my Django project: python manage.py runserver -> the system is not using the virtual environment, but the python from my PC. What is the problem? Why my activated virtual environment does not work?
I am using MacOS. Everything worked until I erased all my data and installed again Python.
Thank you!
If the packages aren't getting installed within your virtual environment, it most likely is the case that you are not using the pip within your virtual environment (or may not have pip within your virtual environment at all, in which case it is defaulting to use the pip installed in /usr/local/bin/). First, check that you have a separate version of pip in your virtual environment located in ./your_virtual_environment_name/bin/pip....If you don't, install from the PyPA download page (https://pip.pypa.io/en/stable/installing/#installing-with-get-pip-py). When you go to install a package within your virtual environment, activate the virtual environment first using source ./bin/activate inside your virtual environment, then "cd .." and you'll use the pip installed within the virtual environment by typing: ./your_virtual_environment_name/bin/pip install * ....The installation will be in ./your_virtual_environment_name/lib/python3.6/site-packages/

Option to import global packages into virtual environment I create?

I am new to using python, so bear with me if I make any assumptions.. So I have virtualenv and pip installed in my ubuntu machine. Every time I create a virtual environment I have to remotely download and install python modules(using pip install) such as django already installed in the main python package.
The problem is that I am not always connected to the internet. Is there a way I can load modules existing in the main Python to every virtual environment I create? Thanks!
You can pip download the Python packages you want to install offline and then install the .whl files in your virtualenv. Here is an example with Django and Requests:
Create a directory to store local Python packages:
mkdir local_python
Change directory: cd local_python
Download Python packages to be available offline:
pip download django requests
Install local package .whl files after you activate your virtualenv:
pip install Django-1.11.1-py2.py3-none-any.whl requests-2.16.5-py2.py3-none-any.whl

How do I automatically run on an environment with Spyder?

Sorry if I am unclear/this is a lame question, still very new to setting up my computer.
So I installed Python using Anaconda for work, and at work there are specific packages that are used internally. I used Anaconda Prompt to install these packages by creating an environment and installing internally used packages. I then check to see if the package is there.
In the Anaconda Prompt...
conda create --name environment_name python = 3.4
activate environment_name
pip install <internal package> --upgrade
pip list
However, when I try to import a package on Spyder, it does not recognize the package. Is there a way for Spyder to run code on an environment that I specify? I would like the environment to run automatically on any file that I run using Spyder, being able to pull the packages that I installed on Anaconda Prompt

Categories

Resources