question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No module named 'virtualenv.activation.xonsh' when run poetry shell command inside the project

See original GitHub issue

I got this when i ran the command poetry shell , i am on the MacOS and pycharm

poetry shell Creating virtualenv go24-pos24-fastapi-uhxSYnFl-py3.9 in /Users/kanel/Library/Caches/pypoetry/virtualenvs

ModuleNotFoundError

No module named ‘virtualenv.activation.xonsh’

at <frozen importlib._bootstrap>:984 in _find_and_load_unlocked

here is my pyproject.toml

[tool.poetry]
name = "go24-pos24-fastapi"
version = "0.1.0"
description = ""
authors = ["kanel soeng <kan3l@gmail.com>"]

[tool.poetry.dependencies]
python = "^3.9"
fastapi = "^0.63.0"
sqlalchemy = "^1.3.18"
uvicorn = {extras = ["standard"], version = "^0.17.1"}
python-dotenv = "^0.14.0"
python-multipart = "^0.0.5"
python-jose = {extras = ["cryptography"], version = "^3.2.0"}
passlib = "^1.7.2"
pydantic = {extras = ["email"], version = "^1.6.1"}
alembic = "^1.4.2"
inflect = "^4.1.0"
bcrypt = "^3.1.7"
sqlalchemy_utils = "^0.36.8"
psycopg2-binary = "^2.8.5"
tenacity = "^6.2.0"
aiofiles = "^0.8.0"

[tool.poetry.dev-dependencies]
pytest = "^5.2"
mypy = "^0.782"
sqlalchemy-stubs = "^0.3"
flake8 = "^3.8.3"
autoflake = "^1.3.1"
isort = "^5.3.2"
black = "^19.10b0"
pytest-cov = "^2.10.1"

[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

7reactions
peterbradencommented, Aug 13, 2022

This is still an issue when running curl -sSL https://install.python-poetry.org | python3 - as mentioned in https://python-poetry.org/docs/master/#installation as of today.

Removing virtualenv does resolve the issue, commenting for those who still run into it.

1reaction
abncommented, Mar 10, 2022

@skanel @Tetfretguru this is a known issue with debian environments with xonsh and a duplicate as pointed out above.

The resolution would be be:

  • remove existing poetry installation and poetry created virtualenvironments maybe
  • remove virtualenv package from python interpreter you are installing poetry with (apt-get remove python3-virtualenv or pip uninstall virtualenv etc this varies depending on your environment)
  • install poetry via one of the options in https://python-poetry.org/docs/master/#installation

Closing this as duplicate of #5201 #5186.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No module named 'virtualenv.activation.xonsh' - Stack Overflow
I tried to remove pipenv, install python with pienv create an alias to python, but anything works. Any idea, I got the same...
Read more >
[Fixed] ModuleNotFoundError: No module named 'virtualenv'
To fix this error, you can run the following command in your Windows shell:.
Read more >
ModuleNotFoundError: No module named 'virtualenv' in Python
To solve the error, install the module by running the pip install virtualenv command. no module named virtualenv. Open your terminal in your ......
Read more >
pipenv: ImportError: No module named 'virtualenv.seed ...
After installing pipenv using pip, I tried to run the command below: $ /home/markhneedham/.local/bin/pipenv shell Creating a virtualenv for this ...
Read more >
xonsh - python as shell replacement / Sudo Null IT News
Surprisingly, there is still no post on the Habré about such a very interesting, replacing the shell as xonsh (github), from my point...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found