したいこと
@Ubuntu22.04, Python3.10 がデフォルトなのですが、3.9を使いたい
前提として、 pyenv とpipenvをインストールしてあります
エラー
pipenvをインストールしようとするとこのエラー
/usr/lib/python3/dist-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: 0.1.43ubuntu1 is an invalid version and will not be supported in a future release
warnings.warn(
/usr/lib/python3/dist-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: 1.1build1 is an invalid version and will not be supported in a future release
warnings.warn(
対処その1
このissueを見ると、バグらしく、 環境変数を書くといいらしい。
$ SETUPTOOLS_USE_DISTUTILS=stdlib pipenv install
この書き方で進んだのですが、
Installing dependencies from Pipfile.lock (fe820e)...
🐍 ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 0/0 — 00:00:00
initできていない気がする。Macでやったときは 初期のPipfileが作成された気がしたのですが。
対処その2
しかたないので、当該フォルダにPipfileを作って入れておきます。例
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
requests = "*"
numpy = "*"
pytest = "6.2.4"
[dev-packages]
[requires]
python_version = "3.9"
エラーは出るけど成功しました。3.9が入っていないのでpyenvで同時に作っています。
$ SETUPTOOLS_USE_DISTUTILS=stdlib pipenv install/usr/lib/python3/dist-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: 0.1.43ubuntu1 is an invalid version and will not be supported in a future releasewarnings.warn(/usr/lib/python3/dist-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: 1.1build1 is an invalid version and will not be supported in a future releasewarnings.warn(Warning: Python 3.9 was not found on your system...Would you like us to install CPython 3.9.13 with Pyenv? [Y/n]: yInstalling CPython 3.9.13 with /home/user/.pyenv/bin/pyenv (this may take a few minutes)...✔ Success!Creating a virtualenv for this project...Pipfile: /home/user/py39/PipfileUsing /home/user/.pyenv/versions/3.9.13/bin/python3.9 (3.9.13) to create virtualenv...⠼ Creating virtual environment...created virtual environment CPython3.9.13.final.0-64 in 803mscreator CPython3Posix(dest=/home/user/.local/share/virtualenvs/py39--M-7vnDl, clear=False, no_vcs_ignore=False, global=False)seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/user/.local/share/virtualenv)added seed packages: pip==22.0.4, setuptools==62.1.0, wheel==0.37.1activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator✔ Successfully created virtual environment!Virtualenv location: /home/user/.local/share/virtualenvs/py39--M-7vnDlPipfile.lock not found, creating...Locking [dev-packages] dependencies...Locking [packages] dependencies...Building requirements...Resolving dependencies...✔ Success!Updated Pipfile.lock (9645ca)!Installing dependencies from Pipfile.lock (9645ca)...🐍 ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 14/14 — 00:00:04To activate this project's virtualenv, run pipenv shell.Alternatively, run a command inside the virtualenv with pipenv run.
0 件のコメント:
コメントを投稿