pypa / pip

The Python package installer
https://pip.pypa.io/
MIT License
9.4k stars 2.99k forks source link

Update error with MayanEDMS #8097

Closed scrummie02 closed 2 months ago

scrummie02 commented 4 years ago

Logged with the Mayan Team and they say it's PIP

Latest ubuntu 18.04 with PIP version 2 latest one in the Ubuntu repos. Trying pip install and get the following:

ERROR: Exception: Traceback (most recent call last): File "/opt/mayan-edms/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 186, in _main status = self.run(options, args) File "/opt/mayan-edms/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 331, in run resolver.resolve(requirement_set) File "/opt/mayan-edms/lib/python3.6/site-packages/pip/_internal/legacy_resolve.py", line 177, in resolve discovered_reqs.extend(self._resolve_one(requirement_set, req)) File "/opt/mayan-edms/lib/python3.6/site-packages/pip/_internal/legacy_resolve.py", line 333, in _resolve_one abstract_dist = self._get_abstract_dist_for(req_to_install) File "/opt/mayan-edms/lib/python3.6/site-packages/pip/_internal/legacy_resolve.py", line 282, in _get_abstract_dist_for abstract_dist = self.preparer.prepare_linked_requirement(req) File "/opt/mayan-edms/lib/python3.6/site-packages/pip/_internal/operations/prepare.py", line 482, in prepare_linked_requirement hashes=hashes, File "/opt/mayan-edms/lib/python3.6/site-packages/pip/_internal/operations/prepare.py", line 287, in unpack_url hashes=hashes, File "/opt/mayan-edms/lib/python3.6/site-packages/pip/_internal/operations/prepare.py", line 164, in unpack_http_url unpack_file(from_path, location, content_type) File "/opt/mayan-edms/lib/python3.6/site-packages/pip/_internal/utils/unpacking.py", line 252, in unpack_file flatten=not filename.endswith('.whl') File "/opt/mayan-edms/lib/python3.6/site-packages/pip/_internal/utils/unpacking.py", line 138, in unzip_file with open(fn, 'wb') as destfp: UnicodeEncodeError: 'ascii' codec can't encode characters in position 81-85: ordinal not in range(128)

Full sequence is here:

REMOVE=/etc/mayan/removals.txt
REQUIRE=/etc/mayan/requirements.txt
REQUIREMENTS=/etc/mayan/requirements
curl https://gitlab.com/mayan-edms/mayan-edms/raw/master/removals.txt > $REMOVE
curl https://gitlab.com/mayan-edms/mayan-edms/raw/master/requirements.txt > $REQUIRE
curl https://gitlab.com/mayan-edms/mayan-edms/-/tree/master/requirements/ > $REQUIREMENTS/base.txt
curl https://gitlab.com/mayan-edms/mayan-edms/-/tree/master/requirements/ > $REQUIREMENTS/build.txt
curl https://gitlab.com/mayan-edms/mayan-edms/-/tree/master/requirements/ > $REQUIREMENTS/common.txt
curl https://gitlab.com/mayan-edms/mayan-edms/-/tree/master/requirements/ > $REQUIREMENTS/development.txt
curl https://gitlab.com/mayan-edms/mayan-edms/-/tree/master/requirements/ > $REQUIREMENTS/documentation.txt
curl https://gitlab.com/mayan-edms/mayan-edms/-/tree/master/requirements/ > $REQUIREMENTS/testing-base.txt
curl https://gitlab.com/mayan-edms/mayan-edms/-/tree/master/requirements/ > $REQUIREMENTS/testing.txt
supervisorctl stop all
ENV=/etc/mayan/env
BIN=/opt/mayan-edms/bin
su - mayan -c ". $ENV && $BIN/pip uninstall -r $REMOVE"
su - mayan -c ". $ENV && $BIN/pip install --upgrade -r $REQUIRE"
McSinyx commented 4 years ago

Could you please reformat the error log with triple backticks? I cannot read all of it but I think the issue is with that the requirement files of invalid format (the URLs should have been */raw/master/requirements/*.txt):

curl https://gitlab.com/mayan-edms/mayan-edms/-/tree/master/requirements/ > $REQUIREMENTS/base.txt
curl https://gitlab.com/mayan-edms/mayan-edms/-/tree/master/requirements/ > $REQUIREMENTS/build.txt
curl https://gitlab.com/mayan-edms/mayan-edms/-/tree/master/requirements/ > $REQUIREMENTS/common.txt
curl https://gitlab.com/mayan-edms/mayan-edms/-/tree/master/requirements/ > $REQUIREMENTS/development.txt
curl https://gitlab.com/mayan-edms/mayan-edms/-/tree/master/requirements/ > $REQUIREMENTS/documentation.txt
curl https://gitlab.com/mayan-edms/mayan-edms/-/tree/master/requirements/ > $REQUIREMENTS/testing-base.txt
curl https://gitlab.com/mayan-edms/mayan-edms/-/tree/master/requirements/ > $REQUIREMENTS/testing.txt

The error log might needs some improvements though (UnicodeEncodeError: 'ascii' codec can't encode characters in position 81-85: ordinal not in range(128) is not the most intuitive thing to parse if I'm in your shoes).

scrummie02 commented 4 years ago
ERROR: Exception: Traceback (most recent call last): File "/opt/mayan-edms/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 186, in _main status = self.run(options, args) File "/opt/mayan-edms/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 331, in run resolver.resolve(requirement_set) File "/opt/mayan-edms/lib/python3.6/site-packages/pip/_internal/legacy_resolve.py", line 177, in resolve discovered_reqs.extend(self._resolve_one(requirement_set, req)) File "/opt/mayan-edms/lib/python3.6/site-packages/pip/_internal/legacy_resolve.py", line 333, in _resolve_one abstract_dist = self._get_abstract_dist_for(req_to_install) File "/opt/mayan-edms/lib/python3.6/site-packages/pip/_internal/legacy_resolve.py", line 282, in _get_abstract_dist_for abstract_dist = self.preparer.prepare_linked_requirement(req) File "/opt/mayan-edms/lib/python3.6/site-packages/pip/_internal/operations/prepare.py", line 482, in prepare_linked_requirement hashes=hashes, File "/opt/mayan-edms/lib/python3.6/site-packages/pip/_internal/operations/prepare.py", line 287, in unpack_url hashes=hashes, File "/opt/mayan-edms/lib/python3.6/site-packages/pip/_internal/operations/prepare.py", line 164, in unpack_http_url unpack_file(from_path, location, content_type) File "/opt/mayan-edms/lib/python3.6/site-packages/pip/_internal/utils/unpacking.py", line 252, in unpack_file flatten=not filename.endswith('.whl') File "/opt/mayan-edms/lib/python3.6/site-packages/pip/_internal/utils/unpacking.py", line 138, in unzip_file with open(fn, 'wb') as destfp: UnicodeEncodeError: 'ascii' codec can't encode characters in position 81-85: ordinal not in range(128)
McSinyx commented 4 years ago

@scrummie02, it's still not rendered correctly by GitHub. By triple backticks I mean

```
log here
```

BTW have you tried correcting the URLs?

scrummie02 commented 4 years ago

Going to try that not, thanks McSinyx, I'll see how that goes and report back

pfmoore commented 4 years ago
curl https://gitlab.com/mayan-edms/mayan-edms/-/tree/master/requirements/ > $REQUIREMENTS/testing.txt

This seems wrong - you're writing a directory listing to a requirements file, which is wrong. And a quick check suggests that the HTML file has non-ASCII characters in it, which explains why you're seeing an encoding error rather than a message about the syntax of the file.

scrummie02 commented 4 years ago

OKay, fresh install with following the directions I get the following:

root@edms1:/home/dain# sudo -u mayan /opt/mayan-edms/bin/pip install --no-use-pep517 mayan-edms
WARNING: The directory '/root/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting mayan-edms
  Downloading mayan_edms-3.4.6-py2.py3-none-any.whl (4.4 MB)
     |################################| 4.4 MB 6.4 MB/s
ERROR: Exception:
Traceback (most recent call last):
  File "/opt/mayan-edms/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 186, in _main
    status = self.run(options, args)
  File "/opt/mayan-edms/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 331, in run
    resolver.resolve(requirement_set)
  File "/opt/mayan-edms/lib/python3.6/site-packages/pip/_internal/legacy_resolve.py", line 177, in resolve
    discovered_reqs.extend(self._resolve_one(requirement_set, req))
  File "/opt/mayan-edms/lib/python3.6/site-packages/pip/_internal/legacy_resolve.py", line 333, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "/opt/mayan-edms/lib/python3.6/site-packages/pip/_internal/legacy_resolve.py", line 282, in _get_abstract_dist_for
    abstract_dist = self.preparer.prepare_linked_requirement(req)
  File "/opt/mayan-edms/lib/python3.6/site-packages/pip/_internal/operations/prepare.py", line 482, in prepare_linked_requirement
    hashes=hashes,
  File "/opt/mayan-edms/lib/python3.6/site-packages/pip/_internal/operations/prepare.py", line 287, in unpack_url
    hashes=hashes,
  File "/opt/mayan-edms/lib/python3.6/site-packages/pip/_internal/operations/prepare.py", line 164, in unpack_http_url
    unpack_file(from_path, location, content_type)
  File "/opt/mayan-edms/lib/python3.6/site-packages/pip/_internal/utils/unpacking.py", line 252, in unpack_file
    flatten=not filename.endswith('.whl')
  File "/opt/mayan-edms/lib/python3.6/site-packages/pip/_internal/utils/unpacking.py", line 138, in unzip_file
    with open(fn, 'wb') as destfp:
UnicodeEncodeError: 'ascii' codec can't encode characters in position 81-85: ordinal not in range(128)

Installation instructions here: https://docs.mayan-edms.com/chapters/deploying.html

It fails on Step 7:

sudo -u mayan /opt/mayan-edms/bin/pip install --no-use-pep517 mayan-edms
uranusjr commented 4 years ago

My guess is your environment has a locale setup incompatible with mayan. Check you LC_ environment variables if you’re on Linux, and try to fix the locale if they do not say UTF-8.

Also, could you provide a reference to your log with the mayan team, where “they say it’s pip”?

scrummie02 commented 4 years ago

https://gitlab.com/mayan-edms/mayan-edms/-/issues/815

THe issue is listed as "closed" external

scrummie02 commented 4 years ago

changing the URLS didn't work.

root@edms1:/home/dain# sudo -u mayan /opt/mayan-edms/bin/pip install --no-use-pep517 mayan-edms
WARNING: The directory '/root/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting mayan-edms
  Downloading mayan_edms-3.4.6-py2.py3-none-any.whl (4.4 MB)
     |################################| 4.4 MB 3.3 MB/s
ERROR: Exception:
Traceback (most recent call last):
  File "/opt/mayan-edms/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 186, in _main
    status = self.run(options, args)
  File "/opt/mayan-edms/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 331, in run
    resolver.resolve(requirement_set)
  File "/opt/mayan-edms/lib/python3.6/site-packages/pip/_internal/legacy_resolve.py", line 177, in resolve
    discovered_reqs.extend(self._resolve_one(requirement_set, req))
  File "/opt/mayan-edms/lib/python3.6/site-packages/pip/_internal/legacy_resolve.py", line 333, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "/opt/mayan-edms/lib/python3.6/site-packages/pip/_internal/legacy_resolve.py", line 282, in _get_abstract_dist_for
    abstract_dist = self.preparer.prepare_linked_requirement(req)
  File "/opt/mayan-edms/lib/python3.6/site-packages/pip/_internal/operations/prepare.py", line 482, in prepare_linked_requirement
    hashes=hashes,
  File "/opt/mayan-edms/lib/python3.6/site-packages/pip/_internal/operations/prepare.py", line 287, in unpack_url
    hashes=hashes,
  File "/opt/mayan-edms/lib/python3.6/site-packages/pip/_internal/operations/prepare.py", line 164, in unpack_http_url
    unpack_file(from_path, location, content_type)
  File "/opt/mayan-edms/lib/python3.6/site-packages/pip/_internal/utils/unpacking.py", line 252, in unpack_file
    flatten=not filename.endswith('.whl')
  File "/opt/mayan-edms/lib/python3.6/site-packages/pip/_internal/utils/unpacking.py", line 138, in unzip_file
    with open(fn, 'wb') as destfp:
UnicodeEncodeError: 'ascii' codec can't encode characters in position 81-85: ordinal not in range(128)
ichard26 commented 2 months ago

This is likely a locale issue, please see https://gitlab.com/mayan-edms/mayan-edms/-/issues/697#note_254941082 for a potential solution.