venv is deprecated since python 3.6
I have installed python 3.7.1 in my notebook. I want to use dash-component-boilerplate as base project for my company. Unfortunately I got error like this.
Executing: python -m venv venv
/usr/bin/python: No module named venv
post_gen_project command failed: python -m venv venv
venv creation failed.
Make sure you have installed virtualenv on python 2.
ERROR: Stopping generation because post_gen_project hook script didn't exit successfully
Hook script failed (exit status: 1)
Hope this issue will be resolved soon.
It looks like /usr/bin/python is pointing to python2.x. What do you get when you type /usr/bin/python --version ?
Python 2.7.10 (2.x) @mbkupfer
Sounds like you had same issue as me. You can either
- skip install of dependencies in cookie cutter set up and install manually Or
- use my fork that has one small edit where it uses python3 instead of python:
cookiecutter https://github.com/mbkupfer/dash-component-boilerplate.git
For step 2 to work, the command: 'python3' should launch a python 3.x interpreter.
Here's the commit I added to my fork so that you can see the difference between mine and plotly's: https://github.com/mbkupfer/dash-component-boilerplate/commit/dcf9aa953eadcff6aebbead4000df0b9d580b3a4
Possible solutions for venv issues:
- Take the python interpreter to use as a cookiecutter variable.
- Take
sys.executableinstead, it will get the current running python from the cookiecutter command, so if the cookiecutter command is on python3 it will use venv, if not it will use virtualenv.
I had the same problem and the issue was from python package managers, I ended up uninstalling virtualenv that I had installed with pip and install it again with conda. This is just an example that causes the same problem, you may have the reverse problem (conda vs pip vs python version 2 or 3), so worth checking out!
pip uninstall virtualenv conda install virtualenv
And then used the provided git in this page cookiecutter https://github.com/mbkupfer/dash-component-boilerplate.git
@behrouzsh the technique that ypu mentioned did not work for me
virtualenv -p python venv virtualenv venv
This worked for me ..