dash-component-boilerplate icon indicating copy to clipboard operation
dash-component-boilerplate copied to clipboard

venv is deprecated since python 3.6

Open achmadk opened this issue 7 years ago • 7 comments

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.

achmadk avatar Jan 18 '19 07:01 achmadk

It looks like /usr/bin/python is pointing to python2.x. What do you get when you type /usr/bin/python --version ?

mbkupfer avatar Feb 03 '19 20:02 mbkupfer

Python 2.7.10 (2.x) @mbkupfer

achmadk avatar Feb 06 '19 04:02 achmadk

Sounds like you had same issue as me. You can either

  1. skip install of dependencies in cookie cutter set up and install manually Or
  2. 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

mbkupfer avatar Feb 06 '19 11:02 mbkupfer

Possible solutions for venv issues:

  1. Take the python interpreter to use as a cookiecutter variable.
  2. Take sys.executable instead, 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.

T4rk1n avatar Feb 06 '19 16:02 T4rk1n

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 avatar May 23 '19 21:05 behrouzsh

@behrouzsh the technique that ypu mentioned did not work for me

a-dwivedi avatar Jul 24 '20 17:07 a-dwivedi

virtualenv -p python venv virtualenv venv

This worked for me ..

vikram-Pyramidions avatar Oct 26 '20 12:10 vikram-Pyramidions