NixosでKubespray Pythonプロジェクトを設定する

NixosでKubespray Pythonプロジェクトを設定する
nix-shell -p libffi openssl python37Packages.virtualenv python37Packages.virtualenvwrapper python37Packages.pip python37Packages.setuptools
...
Collecting certifi>=2017.4.17 (from requests>=2.21.0->hvac==0.8.2->-r requirements.txt (line 5))
  Using cached https://files.pythonhosted.org/packages/b9/63/df50cac98ea0d5b006c55a399c3bf1db9da7b5a24de7890bc9cfd5dd9e99/certifi-2019.11.28-py2.py3-none-any.whl
Collecting idna<2.9,>=2.5 (from requests>=2.21.0->hvac==0.8.2->-r requirements.txt (line 5))
  Using cached https://files.pythonhosted.org/packages/14/2c/cd551d81dbe15200be1cf41cd03869a46fe7226e7450af7a6545bfc474c9/idna-2.8-py2.py3-none-any.whl
Collecting pycparser (from cffi!=1.11.3,>=1.8->cryptography->ansible==2.7.12->-r requirements.txt (line 1))
Installing collected packages: MarkupSafe, jinja2, PyYAML, pycparser, cffi, cryptography, bcrypt, pynacl, paramiko, ansible, netaddr, pbr, chardet, urllib3, certifi, idna, requests, hvac, jmespath, ruamel.yaml
ERROR: Could not install packages due to an EnvironmentError: [Errno 30] Read-only file system: '/nix/store/4c3z5r6yxsf2cxwwyazhdn92xixn4j5b-python3-3.7.5/lib/python3.7/site-packages/MarkupSafe-1.1.1.dist-info'

WARNING: You are using pip version 19.2.3, however version 19.3.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

上記のnixフォークを作成せずに使用できる回避策はありますか?

私は気づきましたが、nixの前にこれを行う必要がpython37Packages.bootstrapped-pipあるため失敗しますunset SOURCE_DATE_EPOCH。 「nixマジック」です...

    File "/nix/store/4c3z5r6yxsf2cxwwyazhdn92xixn4j5b-python3-3.7.5/lib/python3.7/zipfile.py", line 357, in __init__
      raise ValueError('ZIP does not support timestamps before 1980')
  ValueError: ZIP does not support timestamps before 1980

ベストアンサー1

virtualenvこの問題を解決するためにこれを使うことができます:

python3 -m venv env
source env/bin/activate

おすすめ記事