Problems with windows python being called on pipenv on WSL

Status

Not long ago, I was using pipenv on WSL (ubuntu18.04LTS), Although python on WSL was called and there was no problem at all, when I noticed that I had not used WSL for a while, it was in the situation of the title.

I didn't know what was the cause because I was doing some updates on the windows side.

Method

Turn off python in Apps & Features> App Run Alias apl.png

Serpentine

I was confused about whether to insert pipenv or pyenv, so I erased everything once and settled down below. [^ 1]

pyenv install


$ git clone https://github.com/pyenv/pyenv.git ~/.pyenv
$ echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
$ echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
$ echo 'eval "$(pyenv init -)"' >> ~/.bashrc
$ source ~/.bashrc

Python of your choice

$ pyenv install 3.8.1
$ python -V
Python 3.8.1

pipenv install

$ pip list
Package    Version
---------- -------
pip        19.2.3
setuptools 41.2.0
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.
$ pip install --upgrade pip
$ pip install pipenv
$ pip list
Package          Version
---------------- ----------
certifi          2019.11.28
pip              19.3.1
pipenv           2018.11.26
setuptools       41.2.0
virtualenv       16.7.9
virtualenv-clone 0.5.3

Creating an environment for pipenv

If you specify the version you want with pipenv install in the project directory If you haven't already installed it with pyenv, you will be asked if you want to install it.

$ cd your_project
$ pipenv install --python 3.7
Warning: Python 3.7 was not found on your system…
Would you like us to install CPython 3.7.6 with pyenv? [Y/n]:y

Pipfile and Pipfile.lock have been generated.

$ pipenv shell
(your_project) $ python -V
Python 3.7.6
(your_project) $ pyenv versions
  system
  3.7.6
* 3.8.1 (set by PYENV_VERSION environment variable)

It seems to be safe.

reference

https://qiita.com/mashita1023/items/10239f5621ef2fc8acb9 https://qiita.com/foewhoew32f320/items/bfa90ae1003e45cefe33 https://github.com/pypa/pipenv/issues/3488 https://github.com/pyenv/pyenv/tree/4e0ba2f47d97acd1284439cff57af059ce376b9d#installation

[^ 1]: I don't know if it's gone properly

Recommended Posts

Problems with windows python being called on pipenv on WSL
Getting started with Python 3.8 on Windows
[python] When pipenv install of WSL, python on Windows side is called for some reason
Example of building python development environment on windows (wsl2, vscode, pipenv)
Python on Windows
Install OpenCV 4.0 and Python 3.7 on Windows 10 with Anaconda
Organize files on Windows with Linux commands-using WSL-
Install python on WSL
Linux (WSL) on Windows
Python starting with Windows 7
python basic on windows â‘¡
Install python on windows
PIL with Python on Windows 8 (for Google App Engine)
Python development environment with Windows + Python + PipEnv + Visual Studio Code
Set-enable Python virtualenv on Windows
Python with VS Code (Windows 10)
Run python with PyCharm (Windows)
Install watchdog on Windows + Python 3.3
Python + Kivy development on Windows
Sphinx-autobuild (0.5.2) on Windows7, Python 3.5.1, Sphinx 1.3.5
Use Windows 10 fonts with WSL
Fastest Python installation on Windows
Build Python environment on Windows
Build python environment on windows
I ran python on windows
[Python] [Chainer] [Windows] Install Chainer on Windows
Use Python on Windows (PyCharm)
Time synchronization (Windows) with Python
Use Linux on Windows 10 (WSL2)
Blogging with Pelican on Windows
OpenJTalk on Windows10 (Speak Japanese with Python from environment construction)
Let's get started with Python ~ Building an environment on Windows 10 ~
Build Python3 for Windows 10 on ARM with Visual Studio 2019 (x86) on Windows 10 on ARM
Python environment construction memo on Windows 10
Face detection with YOLO Face (Windows10, Python3.6)
Python 3.6 on Windows ... and to Xamarin.
Installing Kivy on Windows10 64bit Python3.5
Anaconda python environment construction on Windows 10
Build a 64-bit Python 2.7 environment with TDM-GCC and MinGW-w64 on Windows 7
Install python2.7 on windows 32bit environment
Install xgboost (python version) on Windows
Install Python on Windows + pip + virtualenv
WSL2 ~ Linux on Windows ~ (Part 1: Introduction)
Install Pytorch on Blender 2.90 python on Windows
Integrate Modelica and Python on Windows
Japanese file enumeration with Python2 system on Windows (5C problem countermeasure)
Run SwitchBot on Windows 10 with Bleak
Solve AtCoder Problems Recommendation with python (20200517-0523)
Installing Kivy-Designer on Windows10 64bit Python3.5
Build mlpy with python3.3 (64bit) (windows 64bit)
Mecab / Cabocha / KNP on Python + Windows
Use Tensorflow 2.1.0 with Anaconda on Windows 10!
Use Windows 10 speech synthesis with Python
Notes on using rstrip with python.
Getting started with USD on Windows
Install Python development environment on Windows 10
Python CGI file created on Windows
pytorch @ python3.8 environment construction with pipenv
Build Python 3.8 + Pipenv environment on Ubuntu 18.04
[Python] Creating multiple windows with Tkinter
Reproduce One-Touch Search on Python 3.7.3. (Windows 10)