Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jun 16 16:43
    arifer612 closed #1993
  • Jun 16 16:43
    arifer612 commented #1993
  • Jun 15 06:52

    gaborbernat on main

    [pre-commit.ci] pre-commit auto… (compare)

  • Jun 15 06:52

    gaborbernat on pre-commit-ci-update-config

    (compare)

  • Jun 15 06:52
    gaborbernat closed #2131
  • Jun 14 17:54
    codecov[bot] commented #2131
  • Jun 14 17:49
    codecov[bot] commented #2131
  • Jun 14 17:36
    codecov[bot] commented #2131
  • Jun 14 17:33
    codecov[bot] commented #2131
  • Jun 14 17:32
    codecov[bot] commented #2131
  • Jun 14 17:31
    codecov[bot] commented #2131
  • Jun 14 17:31
    codecov[bot] commented #2131
  • Jun 14 17:27
    codecov[bot] commented #2131
  • Jun 14 17:27
    codecov[bot] commented #2131
  • Jun 14 17:26
    codecov[bot] commented #2131
  • Jun 14 17:23
    codecov[bot] commented #2131
  • Jun 14 17:22
    codecov[bot] commented #2131
  • Jun 14 17:22
    codecov[bot] commented #2131
  • Jun 14 17:21
    codecov[bot] commented #2131
  • Jun 14 17:20
    codecov[bot] commented #2131
Miguel Alberto Plazas
@ambigus9
Sure @gaborbernat
107 get PythonInfo from /home/miguel/.local/share/virtualenv/py_info/20.0.20/e7370f93d1d0cde622a1f8e1c04877d8463912d04d973331ad4851f04de6915a.json for /bin/python [DEBUG cached_py_info:79]
107 Attempting to release lock 139722758691856 on /home/miguel/.local/share/virtualenv/py_info/20.0.20/e7370f93d1d0cde622a1f8e1c04877d8463912d04d973331ad4851f04de6915a.lock [DEBUG filelock:315]
108 Lock 139722758691856 released on /home/miguel/.local/share/virtualenv/py_info/20.0.20/e7370f93d1d0cde622a1f8e1c04877d8463912d04d973331ad4851f04de6915a.lock [INFO filelock:318]
108 proposed PathPythonInfo(spec=CPython2.7.18.candidate.1-64, exe=/bin/python, platform=linux2, version='2.7.18rc1 (default, Apr  7 2020, 12:05:55) \n[GCC 9.3.0]', encoding_fs_io=UTF-8-None) [INFO builtin:50]
108 discover PATH[7]=/usr/games [DEBUG builtin:84]
108 discover PATH[8]=/usr/local/games [DEBUG builtin:84]
109 discover PATH[9]=/snap/bin [DEBUG builtin:84]
109 RuntimeError: failed to find interpreter for Builtin discover of python_spec='python3.7' [ERROR __main__:57]
Bernát Gábor
@gaborbernat
The error you first posted and this do not match up
TDK
@TDKZG
Hi to all. I have installed 2 venv's just for testing. First one is: 'HelloWorld1': pipenv and 2nd: 'HelloWorld2: venv'
Question is: How can I delete/uninstall the second one? Can you do it with only one command in terminal or I have to manually delete virtualenvs folders in Windows? I'm using Python 3.7.7 + VS Code
Bernát Gábor
@gaborbernat
sorry venv is not virtualenv
Sorin Sbarnea
@ssbarnea
@gaborbernat can you please help me double check something regarding future of venv?
while pyenv is planned for removal, the python3 -m venv there to stay.
no other reasons for not using venv for those that do not need to support py27
Bernát Gábor
@gaborbernat
@ssbarnea not sure I understand
tools will use virtualenv as offers better API
end-users might still be interested in using virtualenv over venv due to virtualenv being faster and fixes bugs faster
plus offers some features (e.g. automatic .gitignore within a venv) and such
IMHO if installing virtualenv is not painful (or if you don't run in some awkward bug using it) it's better over venv
dboeckenhoff
@dboeckenhoff

Hey people. When running my tests with tox in a virtualenv I run into ImportMismatchError, e.g.: ImportMismatchError: ('tfields.main', '/builds/dboe/tfields/.tox/py37/lib/python3.7/site-packages/tfields/main.py', local('/builds/dboe/tfields/tfields/main.py'). Any hints? I keep coming back to https://stackoverflow.com/questions/44067609/getting-error-importmismatcherror-while-running-py-test but am not sure a) if that is my problem and b) how to remove __pycache__ within tox environments

see https://gitlab.mpcdf.mpg.de/dboe/tfields/-/jobs/1121415 for the failing example. It seems like python is confusing the local import with a 3rd party import

Bernát Gábor
@gaborbernat
I don't think this is virtualenv related, but python in general
Deeparth Gupta
@DeeparthGupta
My virtualenvs refer to the global install instead of the environment itself. I've even tried venv but the problem persists. Its been like this since july. Never had a problem before that.
Older environments are suddenly doing the same.
Bernát Gábor
@gaborbernat
hmmm, the fact that venv does the same show me it's your system issue, not virtualenv
@DeeparthGupta did you open an issue for it?
Deeparth Gupta
@DeeparthGupta
Yes.
Blossom
@blossomsg
https://stackoverflow.com/questions/63619308/fails-to-prompt-python-version-and-pip-list-after-creating-virtual-environme?noredirect=1#comment112499062_63619308 i had raised a query for virtualenv on stackoverflow, not much success. I have 2 python env variables "python" and "python3" when i activate the virtualenv works fine, when i list the version from either it shows me both, but when i check the scripts folder there is no python.exe interpreter, I want to do it for python 3.8.3
Blossom
@blossomsg
this is my pyvenv.cfg home = c:\python38
implementation = CPython
version_info = 3.8.3.final.0
virtualenv = 20.0.31
include-system-site-packages = false
version = 3.8.3
Blossom
@blossomsg
please ignore the above, my regular venv was not working because of my foolishness, as i have dual python in my machine, i had changed the name to python3.exe for 3.8, so pycharm was not able to create venv, the fix, i just renamed it to python.exe
Sayam Kumar
@Sayam753
Hello all. I am first time here. And I need some help to understand a particular behaviour of virtualenv.
Sayam Kumar
@Sayam753
If I create a virtualenv with --system-site-packages option, my global packages are visible in the environment but I cannot access environment packages (like tqdm) from command line. I need to specify python -m <package-name> to access them. Maybe the path of environment packages did not get added to sys.path. Can someone help to interpret this behaviour?
Bernát Gábor
@gaborbernat
that shouldn't be the case
Matti Picus
@mattip
What OS are you on? Sometimes on windows the PATH can get too long
Sayam Kumar
@Sayam753
Hi @gaborbernat @mattip . Thanks for the reply. I am using MacOS. Here are my findings
$ uname -a
Darwin My_MacBook 19.6.0 Darwin Kernel Version 19.6.0: Thu Jun 18 20:49:00 PDT 2020; root:xnu-6153.141.1~1/RELEASE_X86_64 x86_64
$ which python3; python3 --version
/usr/local/bin/python3
Python 3.8.5
$ which virtualenv; virtualenv --version
/usr/local/bin/virtualenv
virtualenv 20.0.31 from /usr/local/lib/python3.8/site-packages/virtualenv/__init__.py
No global packages -
$ virtualenv no_global
$ source no_global/bin/activate
(no_global) $ python -c "import sys; print(sys.executable)"
/Users/user/no_global/bin/python
With system packages -
$ virtualenv --system-site-packages with_global
$ source with_global/bin/activate
(with_global) $ python -c "import sys; print(sys.executable)"
/usr/local/opt/python@3.8/bin/python3.8
Sayam Kumar
@Sayam753
The subtle difference is python executable one. That's why the env with system-site-packages is unable to find tqdm. The path inside both environments does include the path for environment packages. So, path is not the issue I guess. Is this the expect behaviour or am I missing something?
Kelsey Wagner
@kelseywa

Hi all, I'm not super clear about how much of the system python is used by the virtual env.

I am looking at setting up a virtual env with python 3.6+ on a server that only has python 2.7.X system wide.
Would this be possible with virtualenv?

Julian Berman
@Julian
@kelseywa Hi! virtualenv doesn't replace installing Python, it's a thing you use after Python is installed.
So your steps likely should involve installing Python3.x and then secondly creating a virtualenv to install your application into.
Kelsey Wagner
@kelseywa
@Julian thanks for your response, I see now that if I try to set up an environment with a python interpreter that isn't on the system it throws a runtime error
time_north
@w345731923
Excuse me, I have a question. Why doesn't my virtual environment have a built-in library?./virtualenv -v --always-copy --clear myenv
marcom-db
@marcom-db
Hi all, it seems that in Virtualenv 20.x, install_wheel was removed. Is there a reason for this, and a replacement for the install_wheel function? To repro this, install Virtualenv 16.x, and run from virtualenv import install_wheel. Then upgrade to Vitualenv 20.x and run from virtualenv import install_wheel. The first line succeeds, while the second fails. Thanks!
Bernát Gábor
@gaborbernat
As advised before just recreate the virtual environment in your case.
Lada Gagina
@lada-gagina
Hello! I need an advice on using the zipapp version of virtualenv. I’m getting the same error as here pypa/virtualenv#1873 on Ubuntu, but the difference is I’m passing the path to the zipapp virtualenv file instead of calling virtualenv. 
Is it intended behavior? I thought that if I’m passing a specific file, there should not be any conflicts between installed versions.
Bernát Gábor
@gaborbernat
How you passing it exactly?
Lada Gagina
@lada-gagina
<path to python> <path to virtualenv.pyz> <path to a place where I want virtual environment to be created>
It works in a terminal if I don't have python3-virtualenv installed, but if I do, it fails with ModuleNotFoundError.
I'd like to figure out if it's an intended behaviour or if I'm using the zipapp incorrectly.
Bernát Gábor
@gaborbernat
Ah ubuntu bad packaging
🤔you pointed the zipapp that already has virtualenv that's with different version, hence the conflicts
You should use zipapp with a python that does not have virtualenv installed within it
Lada Gagina
@lada-gagina
The thing is I'm trying to implement that in PyCharm, so I'm not able to choose the interpreter or delete user's python3-virtualenv :(
Bernát Gábor
@gaborbernat
A better strategy perhaps here is to a) check if it's already installed, if yes just use that instead of zipapp or b) create a virtual environment python and use that to invoke the zipapp.
For the later you can use python3 -m venv --without-pip form.
Bernát Gábor
@gaborbernat
we'll be retiring this channel in favor of Discord at https://discord.gg/uufxTxAMCX :-)