``poetry install`` doesn't install, ``poetry self update`` doesn't update
- [ ] I am on the latest Poetry version.
- [x] I have searched the issues of this repo and believe that this is not a duplicate.
- [x] If an exception occurs when executing a command, I executed it again in debug mode (
-vvvoption).
- OS version and name: CentOS-7
- Poetry version: 1.1.11 (or maybe 1.1.12??)
- Link of a Gist with the contents of your pyproject.toml file:
Issue
Hi all, after returning to a project based on a remote machine I have encountered strange issue where running poetry install (after poetry update) only gives the following output:
Using virtualenv: /path/to/venv
Installing dependencies from lock file
Finding the necessary packages for the current system
Package operations: 25 installs, 2 updates, 0 removals, 4 skipped
i.e. it doesn't actually install anything. I have since tried deleting the venv and poetry.lock file and again running poetry install with no luck. I then tried uninstalling and reinstalling poetry entirely but still get the same issue. I can, however, install packages manually in the subshell using pip.
A hint that something is up is that just running poetry gives me this output:
Poetry version 1.1.11
USAGE
UnicodeEncodeError
'ascii' codec can't encode character '\xa0' in position 30: ordinal not in range(128)
at ~/.local/share/pypoetry/venv/lib/python3.6/site-packages/clikit/io/output_stream/stream_output_stream.py:24 in write
Traceback (most recent call last):
File "/home/goldsack/.local/share/pypoetry/venv/lib/python3.6/site-packages/clikit/console_application.py", line 131, in run
status_code = command.handle(parsed_args, io)
File "/home/goldsack/.local/share/pypoetry/venv/lib/python3.6/site-packages/clikit/api/command/command.py", line 120, in handle
status_code = self._do_handle(args, io)
File "/home/goldsack/.local/share/pypoetry/venv/lib/python3.6/site-packages/clikit/api/command/command.py", line 171, in _do_handle
return getattr(handler, handler_method)(args, io, self)
File "/home/goldsack/.local/share/pypoetry/venv/lib/python3.6/site-packages/clikit/handler/help/help_text_handler.py", line 29, in handle
usage.render(io)
File "/home/goldsack/.local/share/pypoetry/venv/lib/python3.6/site-packages/clikit/ui/help/abstract_help.py", line 31, in render
layout.render(io, indentation)
File "/home/goldsack/.local/share/pypoetry/venv/lib/python3.6/site-packages/clikit/ui/layout/block_layout.py", line 42, in render
element.render(io, self._indentations[i] + indentation)
File "/home/goldsack/.local/share/pypoetry/venv/lib/python3.6/site-packages/clikit/ui/components/labeled_paragraph.py", line 70, in render
+ "\n"
File "/home/goldsack/.local/share/pypoetry/venv/lib/python3.6/site-packages/cleo/io/io_mixin.py", line 55, in write
super(IOMixin, self).write(string, flags)
File "/home/goldsack/.local/share/pypoetry/venv/lib/python3.6/site-packages/clikit/api/io/io.py", line 58, in write
self._output.write(string, flags=flags)
File "/home/goldsack/.local/share/pypoetry/venv/lib/python3.6/site-packages/clikit/api/io/output.py", line 61, in write
self._stream.write(to_str(formatted))
File "/home/goldsack/.local/share/pypoetry/venv/lib/python3.6/site-packages/clikit/io/output_stream/stream_output_stream.py", line 24, in write
self._stream.write(string)
UnicodeEncodeError: 'ascii' codec can't encode character '\xa0' in position 30: ordinal not in range(128)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/goldsack/.local/bin/poetry", line 8, in <module>
sys.exit(main())
File "/home/goldsack/.local/share/pypoetry/venv/lib/python3.6/site-packages/poetry/console/__init__.py", line 5, in main
return Application().run()
File "/home/goldsack/.local/share/pypoetry/venv/lib/python3.6/site-packages/clikit/console_application.py", line 142, in run
trace.render(io, simple=isinstance(e, CliKitException))
File "/home/goldsack/.local/share/pypoetry/venv/lib/python3.6/site-packages/clikit/ui/components/exception_trace.py", line 232, in render
return self._render_exception(io, self._exception)
File "/home/goldsack/.local/share/pypoetry/venv/lib/python3.6/site-packages/clikit/ui/components/exception_trace.py", line 269, in _render_exception
self._render_snippet(io, current_frame)
File "/home/goldsack/.local/share/pypoetry/venv/lib/python3.6/site-packages/clikit/ui/components/exception_trace.py", line 289, in _render_snippet
self._render_line(io, code_line)
File "/home/goldsack/.local/share/pypoetry/venv/lib/python3.6/site-packages/clikit/ui/components/exception_trace.py", line 402, in _render_line
io.write_line("{}{}".format(indent * " ", line))
File "/home/goldsack/.local/share/pypoetry/venv/lib/python3.6/site-packages/cleo/io/io_mixin.py", line 65, in write_line
super(IOMixin, self).write_line(string, flags)
File "/home/goldsack/.local/share/pypoetry/venv/lib/python3.6/site-packages/clikit/api/io/io.py", line 66, in write_line
self._output.write_line(string, flags=flags)
File "/home/goldsack/.local/share/pypoetry/venv/lib/python3.6/site-packages/clikit/api/io/output.py", line 69, in write_line
self.write(string, flags=flags, new_line=True)
File "/home/goldsack/.local/share/pypoetry/venv/lib/python3.6/site-packages/clikit/api/io/output.py", line 61, in write
self._stream.write(to_str(formatted))
File "/home/goldsack/.local/share/pypoetry/venv/lib/python3.6/site-packages/clikit/io/output_stream/stream_output_stream.py", line 24, in write
self._stream.write(string)
UnicodeEncodeError: 'ascii' codec can't encode character '\u2502' in position 27: ordinal not in range(128)
and similarly any time in the past when there has been a version issue when running poetry add or the like the version clash is hidden in a similar UnicodeEncodeError stack trace.
I tried updating poetry by running poetry self update which, as far as I can see, succeeds with the output:
Updating Poetry to 1.1.12
Updating dependencies
Resolving dependencies... (5.3s)
Package operations: 0 installs, 0 updates, 0 removals
Updating the poetry script
Poetry (1.1.12) is installed now. Great!
however running poetry --version tells me I'm still on 1.1.11, implying there are two versions of poetry floating around somehow (PATH only shows one).
My only idea is that poetry has been accidentally partially installed using python2.7 when I first set it up and that's somehow causing conflicting issues. As you can see in the stack trace above it is looking in the right 3.6 libraries so this may not be right but I'm stumped as to what would make it not install with no output. I'm also a little confused as to what changed to mess this up in the first place, we're switching over hardware on this (frankly quite out of date) cluster but as far as I know nothing has actually changed yet. FYI this started when I was trying to install dataclasses (we only have 3.6 on this cluster) but given I've done a fresh install and now have been trying again without the dataclasses dependency I'm fairly sure this isn't the cause.
Any help would be greatly appreciated.
EDIT: I forgot to mention that when reinstalling I did try installing with the most recent get-poetry.py and it still says the version is 1.1.11 so I guess there is something hanging around somewhere.
To add to this, I just manually went and deleted the poetry executable from .local/bin/ and installed using get-poetry.py and it did install 1.1.12, however I still get all the same issues described above.
I was about to post I see same thing. When I run poetry install in a simple project with few deps:
pytest-cov = "^3.0.0"
flake8 = "^4.0.1"
black = "^22.1.0"
mypy = "^0.931"
pre-commit = "^2.17.0"
isort = "^5.10.1"
autoflake = "^1.4"
$ poetry --version
Poetry version 1.1.13
I only see the error when running Jenkins build. If I login to the jenkins node and run build myself I do not see it. I'm on centos7 too. As I was writing up a comment to say I see same I looked at the install page again.. actually there are two different install pages?
- https://python-poetry.org/docs/master/#installing-with-the-official-installer
- https://python-poetry.org/docs/#installation
The first one mentions: Note that the installer does not support Python < 3.7. If you use install-poetry.py method this applies? I noticed in error msgs I had that python 3.6 was referenced. I see same in output submitter posted.
I uninstalled poetry, actived python 3.9 via pyenv, and then install poetry again. My error during Jenkins build disappeared after that.
Regarding the unicode error see https://github.com/python-poetry/poetry/issues/1427#issuecomment-537260307.
If you had an older version installed via the installer, I would recommend using the same to remove it.
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python - --uninstall
The first one mentions:
Note that the installer does not support Python < 3.7.If you use install-poetry.py method this applies? I noticed in error msgs I had that python 3.6 was referenced. I see same in output submitter posted
This is unfortunately incorrect. The installer should work fine under python 3.6.
root@38cf54ec52f5:/# curl -sL https://install.python-poetry.org | python -
Retrieving Poetry metadata
# Welcome to Poetry!
This will download and install the latest version of Poetry,
a dependency and package manager for Python.
It will add the `poetry` command to Poetry's bin directory, located at:
/root/.local/bin
You can uninstall at any time by executing this script with the --uninstall option,
and these changes will be reverted.
Installing Poetry (1.1.13): Done
Poetry (1.1.13) is installed now. Great!
To get started you need Poetry's bin directory (/root/.local/bin) in your `PATH`
environment variable.
Add `export PATH="/root/.local/bin:$PATH"` to your shell configuration file.
Alternatively, you can call Poetry explicitly with `/root/.local/bin/poetry`.
You can test that everything is set up by executing:
`poetry --version`
root@38cf54ec52f5:/# export PATH=/root/.local/bin:$PATH
root@38cf54ec52f5:/# python --version
Python 3.6.15
root@38cf54ec52f5:/# poetry --version
Poetry version 1.1.13
root@38cf54ec52f5:/#
Hello @Goldie643,
you haven't come back to this issue for a long while. So I assume this is solved in the meantime and I can close this ticket.
Feel free to leave a comment if you disagree.
fin swimmer
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.