python-venv

pylint false positive E0401 import errors in vscode while using venv

亡梦爱人 提交于 2020-02-19 09:59:09
问题 I created a venv using python3.6 on my mac os in this folder /Users/kim/Documents/Apps/PythonApps/python36-miros-a3 I ran a pip install pylint after I activated the virtual env My workspace is in /Users/kim/Documents/Apps/WebApps/miros-a3 Inside my vscode workspace, I have the following Workspace settings { "folders": [ { "path": "." } ], "settings": { "python.pythonPath": "/Users/kim/Documents/Apps/PythonApps/python36-miros-a3/bin/python3.6", "python.venvPath": "/Users/kim/Documents/Apps

“<unprintable file name>” error when running pip or venv

谁说我不能喝 提交于 2020-01-24 06:01:43
问题 I have several people on my team that are running into an intermittent problem running some very basic Python commands. The following is all in Windows 10, using the Python Launcher (the py command that allows you to setup a default Python – in our case Python 3.7). Running from a Git repo root directory pip can fail. $ py -m pip install --upgrade pip C:\Apps\Python37\python.exe: can't open file '<unprintable file name>': [Errno 2] No such file or directory or setting up a virtual environment

Control the pip version in virtualenv

邮差的信 提交于 2020-01-22 05:56:23
问题 How do I control the version of pip which is used in a freshly created venv? By default, it uses a vendored pip distribution which may be out of date or unsuitable for whatever other reason. I want to be able to create a venv with a user-specified version of pip installed initially , as opposed to creating one and then upgrading the pip installation from within the env. 回答1: For me, I just upgraded pip/virtualenv/virtualenvwrapper on my machine (not inside the virtualenv). Subsequently

Control the pip version in virtualenv

≡放荡痞女 提交于 2020-01-22 05:56:04
问题 How do I control the version of pip which is used in a freshly created venv? By default, it uses a vendored pip distribution which may be out of date or unsuitable for whatever other reason. I want to be able to create a venv with a user-specified version of pip installed initially , as opposed to creating one and then upgrading the pip installation from within the env. 回答1: For me, I just upgraded pip/virtualenv/virtualenvwrapper on my machine (not inside the virtualenv). Subsequently

How do I update a Python virtual environment with `venv` to use a newer version of Python?

烂漫一生 提交于 2020-01-15 05:09:52
问题 I have recently installed Python 3.8.0 alongside Python 3.7.4. I have some virtual environments (created using python -m venv <directory> that are based on v3.7.4. How do I update them to use v3.8.0? Do I need to create a new virtual environment and reinstall the dependencies, scripts, etc.? Note: There are some existing Q&A's (such as this) that deal with the older virtualenv package/tool. I'm specifically asking about the new built-in venv module, which is a standard built-in to Python

Can't Find or create a new virtualenv

旧时模样 提交于 2020-01-14 06:20:26
问题 I just got Python 3.5.2 and wanted to create a virtualenv. I have done this before. Right now, I have a virtualenv on a Python2.7 project that I can still open with source bin/activate. But try as I might, from /home, or from /path/to/virtualenv, or /path/to/virtualenv-$, with or without sudo and python prepended on the command line, I only get one response: no such file or directory. This was with the -p flag so it would use 3.5.2, because 2.7.12 is still my default. If it is broken, why

python3 -m venv: how to specify Python point release/version?

若如初见. 提交于 2019-12-25 00:58:40
问题 To create a virtual environment using virtualenv you can specify the Python release and point version like so: virtualenv --python=python3.6 .venv How can I achieve this using Python3's venv module (as in python3 -m venv .newvenv )? According to the documentation using venv is the recommended way to create virtual environments but I didn't see how I can choose a virtual environement with a specific Python version. 回答1: Run venv with whatever Python installation you want to use for the new

How to activate virtualenv using PowerShell?

微笑、不失礼 提交于 2019-12-25 00:07:52
问题 I made virtualenv called bitcoin_notifications.py and I'm going to activate it but: PS C:\Users\piotr> bitcoin_notifications\activate.ps1 bitcoin_notifications\activate.ps1 : The module 'bitcoin_notifications' could not be loaded. For more information, run 'Import-Module bitcoin_notifications'. At line:1 char:1 + bitcoin_notifications\activate.ps1 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (bitcoin_notifications\activate.ps1:String) [], CommandNotFoundException +

Pip installing packages to global site-packages when inside virtual environment

时光总嘲笑我的痴心妄想 提交于 2019-12-24 02:13:58
问题 Let me preface this by stating that I have read pip installing in global site-packages instead of virtualenv and it did not solve my problem. When creating a virtual environment using python -m venv venv (or any other name) and then activating said venv using source venv/bin/activate , running pip install [package] actually installs the package to the (user) global python site packages, located in ~/.local/lib/python3.7/site-packages/ . Interestingly, it always tries to install the packages

Anaconda environment bash prefix too long

余生长醉 提交于 2019-12-23 18:06:59
问题 I created an anaconda environment in a project folder specifying the path with -p option, i.e. not in the default anaconda3/envs folder: conda create -p venv The problem is that when I activate that environment, the bash prefix in the terminal is too long, i.e. it prepends the entire path of the environment to the prompt: (/path/to/the/environment/venv) user@machine: ~/path/to/environment/$ Is there a way to fix this, meaning make it shorter or delete the prefix from prompt? My $PS1: \[\e]0;