在GitLab CI上,在将streamlit
升级到1.10.0后,我在运行pip install streamlit
时出现以下错误:
ERROR: Exception:
Traceback (most recent call last):
File "/builds/project/venv/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 164, in exc_logging_wrapper
status = run_func(*args)
File "/builds/project/venv/lib/python3.6/site-packages/pip/_internal/cli/req_command.py", line 205, in wrapper
return func(self, options, args)
File "/builds/project/venv/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 413, in run
pycompile=options.compile,
File "/builds/lproject/venv/lib/python3.6/site-packages/pip/_internal/req/__init__.py", line 81, in install_given_reqs
pycompile=pycompile,
File "/builds/project/venv/lib/python3.6/site-packages/pip/_internal/req/req_install.py", line 810, in install
requested=self.user_supplied,
File "/builds/project/venv/lib/python3.6/site-packages/pip/_internal/operations/install/wheel.py", line 737, in install_wheel
requested=requested,
File "/builds/project/venv/lib/python3.6/site-packages/pip/_internal/operations/install/wheel.py", line 589, in _install_wheel
file.save()
File "/builds/project/venv/lib/python3.6/site-packages/pip/_internal/operations/install/wheel.py", line 383, in save
if os.path.exists(self.dest_path):
File "/builds/project/venv/lib/python3.6/genericpath.py", line 19, in exists
os.stat(path)
UnicodeEncodeError: 'ascii' codec can't encode character 'U0001f4f9' in position 76: ordinal not in range(128)
我检查了错误的编码字符,它对应于摄像机表情符号📹=U0001f4f9
。
我怎么解决它?
这个bug是由Streamlit 1.10.0引入的。streamlit hello
命令引入多页特性后,新增摄像机表情:https://github.com/streamlit/streamlit/tree/release/1.10.0/lib/streamlit/hello/pages
$ locale || true
LANG=
LANGUAGE=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=
我使用:
before_script:
- apt-get install -y locales
- echo "en_US UTF-8" > /etc/locale.gen
- locale-gen en_US.UTF-8
- export LANG=en_US.UTF-8
- export LANGUAGE=en_US:en
- export LC_ALL=en_US.UTF-8
,现在它工作了。
感谢比尔的回答。