λ¬Έμ
virtualenv test
νΈμΆν λ λͺ¨λ κ°μ νκ²½ νμΌμ΄ μλ testλΌλ ν΄λλ₯Ό λ§λ€ κ²μΌλ‘ μμν©λλ€. κ΄μ°°λ λμμ ν΄λ ν
μ€νΈκ° μμ±λμ§ μμ λ€μ λ©μμ§μΌ λΏμ
λλ€.
ModuleNotFoundError: No module named 'virtualenv.seed.via_app_data'
νκ²½
μ΅μν λ€μμ μ 곡νμμμ€.
pip list
virtualenv
κ° μ€μΉλ νΈμ€νΈ νμ΄μ¬μ Package Version
---------------------- -------------
appdirs 1.4.4
apturl 0.5.2
awscli 1.17.14
blinker 1.4
botocore 1.14.14
Brlapi 0.7.0
certifi 2019.11.28
chardet 3.0.4
chrome-gnome-shell 0.0.0
colorama 0.4.3
command-not-found 0.3
cryptography 2.8
cupshelpers 1.0
dbus-python 1.2.16
defer 1.0.6
distlib 0.3.0
distro 1.4.0
distro-info 0.23ubuntu1
docutils 0.16
entrypoints 0.3
filelock 3.0.12
httpie 1.0.3
httplib2 0.14.0
idna 2.8
importlib-metadata 1.5.0
jmespath 0.9.4
keyring 18.0.1
language-selector 0.1
launchpadlib 1.10.13
lazr.restfulclient 0.14.2
lazr.uri 1.0.3
louis 3.12.0
macaroonbakery 1.3.1
more-itertools 4.2.0
netifaces 0.10.4
oauthlib 3.1.0
olefile 0.46
pexpect 4.6.0
Pillow 7.0.0
pip 20.1.1
protobuf 3.6.1
pyasn1 0.4.2
pycairo 1.16.2
pycups 1.9.73
Pygments 2.6.1
PyGObject 3.36.0
PyJWT 1.7.1
pymacaroons 0.13.0
PyNaCl 1.3.0
pyRFC3339 1.1
python-apt 2.0.0
python-dateutil 2.7.3
python-debian 0.1.36ubuntu1
pytz 2019.3
pyxdg 0.26
PyYAML 5.3.1
reportlab 3.5.34
requests 2.22.0
requests-unixsocket 0.2.0
roman 2.0.0
rsa 4.0
s3transfer 0.3.3
SecretStorage 2.3.1
setuptools 45.2.0
simplejson 3.16.0
six 1.14.0
systemd-python 234
ubuntu-advantage-tools 20.3
ubuntu-drivers-common 0.0.0
ufw 0.36
unattended-upgrades 0.1
urllib3 1.25.8
virtualenv 20.0.24
wadllib 1.3.3
wheel 0.34.2
xkit 0.0.0
zipp 1.0.0
```
**Output of the virtual environment creation**
```console
71 setup logging to NOTSET [DEBUG report:42]
88 find interpreter for spec PythonSpec(path=/usr/bin/python3) [INFO builtin:44]
88 proposed PythonInfo(spec=CPython3.8.2.final.0-64, exe=/usr/bin/python3, platform=linux, version='3.8.2 (default, Apr 27 2020, 15:53:34) \n[GCC 9.3.0]', encoding_fs_io=utf-8-utf-8) [INFO builtin:50]
88 accepted PythonInfo(spec=CPython3.8.2.final.0-64, exe=/usr/bin/python3, platform=linux, version='3.8.2 (default, Apr 27 2020, 15:53:34) \n[GCC 9.3.0]', encoding_fs_io=utf-8-utf-8) [DEBUG builtin:52]
89 filesystem is case-sensitive [DEBUG info:28]
Traceback (most recent call last):
File "/home/florian/.local/bin/virtualenv", line 8, in <module>
sys.exit(run_with_catch())
File "/home/florian/.local/lib/python3.8/site-packages/virtualenv/__main__.py", line 63, in run_with_catch
run(args, options)
File "/home/florian/.local/lib/python3.8/site-packages/virtualenv/__main__.py", line 17, in run
session = cli_run(args, options)
File "/home/florian/.local/lib/python3.8/site-packages/virtualenv/run/__init__.py", line 24, in cli_run
session = session_via_cli(args, options)
File "/home/florian/.local/lib/python3.8/site-packages/virtualenv/run/__init__.py", line 32, in session_via_cli
parser, elements = build_parser(args, options)
File "/home/florian/.local/lib/python3.8/site-packages/virtualenv/run/__init__.py", line 60, in build_parser
SeederSelector(interpreter, parser),
File "/home/florian/.local/lib/python3.8/site-packages/virtualenv/run/plugin/seeders.py", line 8, in __init__
possible = self.options("virtualenv.seed")
File "/home/florian/.local/lib/python3.8/site-packages/virtualenv/run/plugin/base.py", line 39, in options
cls._OPTIONS = cls.entry_points_for(key)
File "/home/florian/.local/lib/python3.8/site-packages/virtualenv/run/plugin/base.py", line 18, in entry_points_for
return OrderedDict((e.name, e.load()) for e in cls.entry_points().get(key, {}))
File "/home/florian/.local/lib/python3.8/site-packages/virtualenv/run/plugin/base.py", line 18, in <genexpr>
return OrderedDict((e.name, e.load()) for e in cls.entry_points().get(key, {}))
File "/usr/lib/python3.8/importlib/metadata.py", line 77, in load
module = import_module(match.group('module'))
File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 961, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'virtualenv.seed.via_app_data'
virtualenvλ μ΄λ»κ² μ€μΉνμ ¨λμ?
sudo apt install python3-virtualenv
λλ μ΄λ―Έ μ±κ³΅μ μΌλ‘ μ κ±°νκ³ μ¬λ¬ λ² λ€μ μ€μΉνμ΅λλ€.
μ΄ κ²½μ° λ¬Έμ λ virtualenv νλ‘μ νΈκ° μλλΌ λ°λΉμμ λ€μ ν¨ν€μ§νλ κ²μ΄λ―λ‘ http://bugs.debian.org/cgi-bin/pkgreport.cgi?package=python3-virtualenvμμ λ¬Έμ λ₯Ό λ³΄κ³ νμΈμ.
κ·Έλμ μ°λ¦¬μ λ체 μ€μΉ λ°©λ²μ μ¬μ©νμ¬ λ°λΉμ λ²μ μ΄ μλ https://virtualenv.pypa.io/en/latest/installation.html#installationμ λ€μ΄λ‘λν μ
@kitterma μ°Έκ³ λ‘
λ§€μ° λΉ λ₯Έ μλ΅μ μ£Όμ μ λλ¨ν κ°μ¬ν©λλ€... λ€λ₯Έ μ€μΉ λ°©λ²μ μλνκ² μ΅λλ€.
μ
λ°μ΄νΈ:
apt removeλ‘ μ κ±°νκ³ μ΄λ―Έ μ€μΉλμ΄ μλ€κ³ pipλ‘ μ€μΉ λ°©λ²μ μλνμ΅λλ€. --force-reinstall
λ‘ μ¬μ€μΉλ₯Ό μλν ν λͺ¨λ κ²μ΄ μ μλν©λλ€.
κ°μ¬ ν΄μ. λ§μ§λ§ Ubuntu 릴리μ€λ λ°λΉμμμ λͺ κ°μ§ λ¬Έμ λ₯Ό κ³μ ν΄κ²°νκ³ μλ μμ μμ λ°μνμ΅λλ€. μ°λΆν¬μμ μ§μ μμ νμ§ μμμ μμΈν λ΄μ©μ μ λͺ¨λ₯΄κ² μ΅λλ€.
μ¬μ€μΉλ‘ λ¬Έμ κ° ν΄κ²°λμ΄ κΈ°μ©λλ€.
@kitterma λ pipλ₯Ό μ¬μ©νμ¬ λ€μ μ€μΉνμΌλ©° apt-getμ μ μνμ΅λλ€. λ°λΌμ μ΄ μ체λ μ¬μ ν λ°λΉμ μμ€μμ μμλμμ΅λλ€.
κ°μ¬ ν΄μ. κ·Έκ²μ λμ³€λ€. μ°λΆν¬μμ ν μ€νΈνμ§ μμμ΅λλ€. κ·Έλλ λ°λΉμμμλ μλν©λλ€.
λΉμ μ virtualenv λ²μ μ 무μμ λκΉ? μ°Έκ³ virtualenv 20.0.24λ λ΄λΆ ꡬν μΈλΆ μ¬ν λͺ¨λ μλλ₯Ό 리ν©ν°λ§νμ΅λλ€... λ°λΌμ κ·Έ μ΄νλ‘ μμ νμ§ μμΌλ©΄ λ°λΉμ ν¨μΉκ° μμλ μ μμ΅λλ€.
λ€μ νλ² μ»΄ν¨ν° μμμ νμΈνκ³ νμΈνκ² μ΅λλ€.
μ°Έκ³ virtualenv 20.0.24λ λ΄λΆ ꡬν μΈλΆ μ¬ν λͺ¨λ μλλ₯Ό 리ν©ν°λ§νμ΅λλ€... λ°λΌμ κ·Έ μ΄νλ‘ μμ νμ§ μμΌλ©΄ λ°λΉμ ν¨μΉκ° μμλ μ μμ΅λλ€.
Ubuntu 20.04μ λ²μ μ 20.0.17μ λλ€.
λ¬Έμ μ μμΆμ μ /home/florian/.local/lib/python3.8/site-packages/virtualenv/
κ°λ¦¬ν€λ―λ‘ @make-ingμ΄ pipλ₯Ό ν΅ν΄ 2.0.24λ₯Ό μ€μΉνμΌλ©° ν΄λΉ μ€μΉκ° μ΄λ»κ²λ μ€λ¨λ κ² κ°μ΅λλ€. μ΄κ²μ sys.path
μ Ubuntu virtualenv
λͺ¨λ μ΄μ μ
λλ€.
μ°λ¦¬ μμμλ λ°λΉμ λ²μ κ³Ό pip λ²μ μ΄ λͺ¨λ μ€μΉλ κ²μ²λΌ 보μ΄μ§λ§ λ°λΉμ λ²μ μ μ κ±°ν νμλ μ΅μ (20.0.25) pip λ²μ μμ μλνλλ‘ ν μ μμμ΅λλ€. λͺ¨λ κ²μ΄ μλν©λλ€ ...
sudo pip3 install virtualenv==20.0.23
@gaborbernat μμ§ 2.0.24λ₯Ό ν¨ν€μ§νμ§ μμμΌλ―λ‘ Debian λλ Ubuntuμ 2.0.24λ λ°°ν¬ν ν¨ν€μ§κ³Ό κ΄λ ¨μ΄ μμ΅λλ€.
λ°λΌμ pipμ aptλ₯Ό ν΅ν΄ λμμ virtualenvλ₯Ό μ€μΉνλ μ¬μ©μμ 리ν¬μ§ν 리 κ°μ μΆ©λμ΄ μ΄λ₯Ό νΈλ¦¬κ±°ν©λλ€. μ΄λ€ μμΌλ‘λ λ°λΉμμ κ·Έλ¬ν κ²½μ°μ μ½κ°μ μ€λ₯λ₯Ό μΌμΌν¬ μ μμ΅λκΉ?
pip(apt-get μλ)λ‘ virtualenvλ₯Ό μ€μΉν λ μ°λΆν¬ λ°μ΄μ€λμμλ μ΄ λ¬Έμ λ₯Ό κ²ͺμμ΅λλ€. 20.0.23μΌλ‘ λ€μ΄ κ·Έλ μ΄λνλ©΄ μ κ²½μ°μλ ν΄κ²°λμμ΅λλ€.
λν λ²μ μ 20.0.23μΌλ‘ λ€μ΄κ·Έλ μ΄λνλ©΄ focal fossa λ¬Έμ κ° ν΄κ²°λλ€λ κ²λ νμΈν μ μμ΅λλ€.
λλ κ°μ λ¬Έμ λ₯Ό μκ³ μμ΄. λ€μ΄κ·Έλ μ΄λλ μ΄λ»κ² νλμ?
@ruannyury pip uninstall virtualenv
λ€μ pip install virtualenv==20.0.23
μ΄ λͺ¨λ κ²½μ°μ λ€μ΄κ·Έλ μ΄λλ μ€μ μ루μ μ΄ μλλλ€. μ§κΈμ λ¬Έμ λ₯Ό ν΄κ²°ν μ μμ§λ§ μννΈμ¨μ΄μ μ€λλ λ²μ μ λ°κ² λ©λλ€. λ λ²μ μ λ³λ ¬λ‘ μ€μΉν μ΄μ λ₯Ό μμλ΄κ³ λ λ€ μ κ±°ν λ€μ μ λ²μ μ μ€μΉνλ κ²μ΄ μ’μ΅λλ€.
μμλ΄λ λ°©λ²? λΆνΈμ λν μ©μ
λ΄ OSλ Manjaro 20.0.3μ λλ€.
ν μ κ±° virtualenv, ν μ κ±° virtualenv? (λ λ² νμΈμ)
λ λ²μ§Έ μκ°:
`μ€λ₯: μμΈ:
μμΆμ (κ°μ₯ μ΅κ·Ό νΈμΆ λ§μ§λ§):
νμΌ "/usr/lib/python3.8/shutil.py", 788ν, μ΄λ μ€
os.rename(src, real_dst)
OSError: [Errno 18] λ§ν¬ νλͺ© 무ν¨ν: '/usr/bin/virtualenv' -> '/tmp/pip-uninstall-mpsr19ya/virtualenv'
μμ μμΈλ₯Ό μ²λ¦¬νλ λμ λ€λ₯Έ μμΈκ° λ°μνμ΅λλ€.
μμΆμ (κ°μ₯ μ΅κ·Ό νΈμΆ λ§μ§λ§):
νμΌ "/usr/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", 186ν, _main
μν = self.run(μ΅μ
, μΈμ)
νμΌ "/usr/lib/python3.8/site-packages/pip/_internal/commands/uninstall.py", 78ν, μ€ν μ€
uninstall_pathset = req.uninstall(
μ κ±° μ νμΌ "/usr/lib/python3.8/site-packages/pip/_internal/req/req_install.py", 687ν
uninstalled_pathset.remove(auto_confirm, μμΈν μ 보)
νμΌ "/usr/lib/python3.8/site-packages/pip/_internal/req/req_uninstall.py", 394ν, μ κ±°
μ΄λ.stash(κ²½λ‘)
νμΌ "/usr/lib/python3.8/site-packages/pip/_internal/req/req_uninstall.py", 283ν, μ¨κΉ
μ΄λ¦ λ°κΎΈκΈ°(κ²½λ‘, new_path)
νμΌ "/usr/lib/python3.8/site-packages/pip/_internal/utils/misc.py", 334ν, μ΄λ¦ λ³κ²½
shutil.move(μ΄μ , μ)
νμΌ "/usr/lib/python3.8/shutil.py", 803ν, μ΄λ μ€
os.unlink(src)
PermissionError: [Errno 13] νμ© μ€λ₯: '/usr/bin/virtualenv'
`
sudoλ₯Ό μ¬μ©ν΄μΌν©λκΉ?
os μ€μΉ νλ‘κ·Έλ¨μΌλ‘ μ€μΉνμ μλ μμ΅λλ€. μ κ±°λ μλνμκ² μ΅λκΉ?
μνΌμ μ μ?
μ
λ°μ΄νΈ: μμλ€.
κ·ΈλΌ λ€μ μ€μΉν κΉμ?
Lubuntu 20.04 μ λ κ°μ λ¬Έμ κ° μμμ΅λλ€. virtualenv==20.0.23μΌλ‘ λλλ €μ ν΄κ²°λ¨
μ΄ λͺ¨λ κ²½μ°μ λ€μ΄κ·Έλ μ΄λλ μ€μ μ루μ μ΄ μλλλ€. μ§κΈμ λ¬Έμ λ₯Ό ν΄κ²°ν μ μμ§λ§ μννΈμ¨μ΄μ μ€λλ λ²μ μ λ°κ² λ©λλ€. λ λ²μ μ λ³λ ¬λ‘ μ€μΉν μ΄μ λ₯Ό μμλ΄κ³ λ λ€ μ κ±°ν λ€μ μ λ²μ μ μ€μΉνλ κ²μ΄ μ’μ΅λλ€.
κ°μ₯ μ μ©ν λκΈ
μ°λ¦¬ μμμλ λ°λΉμ λ²μ κ³Ό pip λ²μ μ΄ λͺ¨λ μ€μΉλ κ²μ²λΌ 보μ΄μ§λ§ λ°λΉμ λ²μ μ μ κ±°ν νμλ μ΅μ (20.0.25) pip λ²μ μμ μλνλλ‘ ν μ μμμ΅λλ€. λͺ¨λ κ²μ΄ μλν©λλ€ ...