You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the "lib" directory of my conda environment, there is the main folder python3.10, and then a symlink to that folder called python3.1. I'm not quite sure why that symlink is there; apparently conda put it automatically when building the environment. But for whatever reason this crashes Spyder with the error "pylint_venv.IncompatibleVenvError: The virtual environment '/Users/mike/Library/miniconda3/envs/core' has multiple lib/pythonX.Y directories."
Traceback
pylint error:
Using venv: /Users/mike/Library/miniconda3/envs/core
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/Users/mike/Library/miniconda3/envs/spyder-env/lib/python3.11/site-packages/pylint/__main__.py", line 10, in <module>
pylint.run_pylint()
File "/Users/mike/Library/miniconda3/envs/spyder-env/lib/python3.11/site-packages/pylint/__init__.py", line 36, in run_pylint
PylintRun(argv or sys.argv[1:])
File "/Users/mike/Library/miniconda3/envs/spyder-env/lib/python3.11/site-packages/pylint/lint/run.py", line 138, in __init__
args = _preprocess_options(self, args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/mike/Library/miniconda3/envs/spyder-env/lib/python3.11/site-packages/pylint/config/utils.py", line 273, in _preprocess_options
cb(run, value)
File "/Users/mike/Library/miniconda3/envs/spyder-env/lib/python3.11/site-packages/pylint/config/utils.py", line 169, in _init_hookexec(value) # pylint: disable=exec-used^^^^^^^^^^^
File "<string>", line 1, in <module>
File "/Users/mike/Library/miniconda3/envs/spyder-env/lib/python3.11/site-packages/pylint_venv.py", line 131, in inithook
activate_venv(venv)
File "/Users/mike/Library/miniconda3/envs/spyder-env/lib/python3.11/site-packages/pylint_venv.py", line 94, in activate_venvraise IncompatibleVenvError(
pylint_venv.IncompatibleVenvError: The virtual environment '/Users/mike/Library/miniconda3/envs/core' has multiple lib/pythonX.Y directories.
Hi @battaglia01 thank you for the feedback! Seems like using the symlink is a decision made for the anaconda and conda-forge Python packages to prevent errors with old conda version and Python >= 3.10. You can see conda/conda#11423 (comment)
However, this causes an issue then with pylint-venv since it has some logic to detect multiple pythonX.Y folders inside lib. I think we will need to check if it is possible to add to the validation done in pylint-venv a case for multiple lib/pythonX.Y directories actually pointing to the same directory and try to submit a PR to the project? What do you think @ccordoba12 ?
For the moment I guess a workaround is using Python <=3.9 in your envs if you want to use Code analysis :/
Description
What steps will reproduce the problem?
In the "lib" directory of my conda environment, there is the main folder python3.10, and then a symlink to that folder called python3.1. I'm not quite sure why that symlink is there; apparently conda put it automatically when building the environment. But for whatever reason this crashes Spyder with the error "pylint_venv.IncompatibleVenvError: The virtual environment '/Users/mike/Library/miniconda3/envs/core' has multiple lib/pythonX.Y directories."
Traceback
Versions
Dependencies
Environment
Environment
The text was updated successfully, but these errors were encountered: