Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Poetry 1.1.8 POETRY_VIRTUALENVS_CREATE=false install broken #4414

Closed
GeniusWiki opened this issue Aug 20, 2021 · 3 comments · Fixed by #4433
Closed

Poetry 1.1.8 POETRY_VIRTUALENVS_CREATE=false install broken #4414

GeniusWiki opened this issue Aug 20, 2021 · 3 comments · Fixed by #4433
Labels
kind/bug Something isn't working as expected

Comments

@GeniusWiki
Copy link

Got this weird issue for my production docker build. RUN POETRY_VIRTUALENVS_CREATE=false poetry install. I am still investigating why, but downgrade 1.1.7 fix this.

Step 13/18 : RUN POETRY_VIRTUALENVS_CREATE=false poetry install
 ---> Running in ce1f705aeb5b
Skipping virtualenv creation, as specified in config file.
Installing dependencies from lock file
Package operations: 116 installs, 13 updates, 0 removals
  
  • Installing click (7.1.2)
  OSError
  Could not find a suitable TLS CA certificate bundle, invalid path: /usr/local/lib/python3.8/dist-packages/certifi/cacert.pem
  at /usr/local/lib/python3.8/dist-packages/requests/adapters.py:227 in cert_verify
      223│             if not cert_loc:
      224│                 cert_loc = extract_zipped_paths(DEFAULT_CA_BUNDLE_PATH)
      225│ 
      226│             if not cert_loc or not os.path.exists(cert_loc):
    → 227│                 raise IOError("Could not find a suitable TLS CA certificate bundle, "
      228│                               "invalid path: {}".format(cert_loc))
      229│ 
      230│             conn.cert_reqs = 'CERT_REQUIRED'
@GeniusWiki GeniusWiki added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Aug 20, 2021
@christopherpickering
Copy link

christopherpickering commented Aug 20, 2021

I'm guessing thats ubuntu 20.4...

I have a similar problem in this weeks release. It seems like poetry is using the system python to install when you do "POETRY_VIRTUALENVS_CREATE=false" instead of the python env you are currently in.

for example

$(which python3) -m pip install --disable-pip-version-check --quiet virtualenv setuptools wheel 
venv/bin/python -m pip install --disable-pip-version-check poetry
venv/bin/poetry config virtualenvs.create false
venv/bin/poetry install --no-dev 

would (prior the a release on Tuesday?) install the poetry dependancies inside of the newly created venv, but now, it attempts to install them inside the system python ( $(which python3) ) unfortunately!

If I "activate" the venv source venv/bin/activate, then run python -m poetry install --no-dev, it will install correctly into the venv.

As an alternate using poetry completely (I was initially try to avoid installing poetry globally on my web servers, but guess it works :) )

Using poetry to manage the venv vs virtualenv. The only difference seems to be the name (venv vs .venv)

curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | $(which python3) -
"$HOME/.local/bin/poetry" config --local virtualenvs.create true
"$HOME/.local/bin/poetry" config --local virtualenvs.in-project true
"$HOME/.local/bin/poetry" install --no-dev

@azmeuk
Copy link

azmeuk commented Aug 20, 2021

Same here with alpine 3.14.

poetry.toml

[virtualenvs]
create = false
poetry install --no-dev
Skipping virtualenv creation, as specified in config file.
Installing dependencies from lock file

Package operations: 67 installs, 6 updates, 8 removals

  • Removing cryptography (3.4.7): Failed

  EnvCommandError

  Command ['/usr/bin/pip', 'uninstall', 'cryptography', '-y'] errored with the following return code 2, and output:
  Found existing installation: cryptography 3.3.2
  Uninstalling cryptography-3.3.2:
  ERROR: Exception:
  Traceback (most recent call last):
    File "/usr/lib/python3.9/shutil.py", line 806, in move
      os.rename(src, real_dst)
  PermissionError: [Errno 13] Permission denied: '/usr/lib/python3.9/site-packages/cryptography' -> '/tmp/pip-uninstall-y0627z55'

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "/usr/lib/python3.9/site-packages/pip/_internal/cli/base_command.py", line 223, in _main
      status = self.run(options, args)
    File "/usr/lib/python3.9/site-packages/pip/_internal/commands/uninstall.py", line 89, in run
      uninstall_pathset = req.uninstall(
    File "/usr/lib/python3.9/site-packages/pip/_internal/req/req_install.py", line 686, in uninstall
      uninstalled_pathset.remove(auto_confirm, verbose)
    File "/usr/lib/python3.9/site-packages/pip/_internal/req/req_uninstall.py", line 403, in remove
      moved.stash(path)
    File "/usr/lib/python3.9/site-packages/pip/_internal/req/req_uninstall.py", line 292, in stash
      renames(path, new_path)
    File "/usr/lib/python3.9/site-packages/pip/_internal/utils/misc.py", line 355, in renames
      shutil.move(old, new)
    File "/usr/lib/python3.9/shutil.py", line 824, in move
      rmtree(src)
    File "/usr/lib/python3.9/shutil.py", line 718, in rmtree
      _rmtree_safe_fd(fd, path, onerror)
    File "/usr/lib/python3.9/shutil.py", line 675, in _rmtree_safe_fd
      onerror(os.unlink, fullname, sys.exc_info())
    File "/usr/lib/python3.9/shutil.py", line 673, in _rmtree_safe_fd
      os.unlink(entry.name, dir_fd=topfd)
  PermissionError: [Errno 13] Permission denied: 'fernet.py'

Copy link

github-actions bot commented Mar 2, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants