Skip to content

Commit 83e6689

Browse files
committed
fFx the pypi windows venv command error without virtualenv package
Signed-off-by: Jiyeong Seok <[email protected]>
1 parent 2d58e21 commit 83e6689

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/fosslight_dependency/analyze_dependency.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,13 +203,16 @@ def check_virtualenv_arg():
203203

204204
venv_path = os.path.join(CUR_PATH, venv_tmp_dir)
205205

206-
if python_version == 2:
207-
create_venv_command = "virtualenv -p python " + venv_tmp_dir
206+
if check_os() == "Windows":
207+
create_venv_command = "python -m venv " + venv_tmp_dir
208208
else:
209-
create_venv_command = "virtualenv -p python3 " + venv_tmp_dir
209+
if python_version == 2:
210+
create_venv_command = "virtualenv -p python " + venv_tmp_dir
211+
else:
212+
create_venv_command = "virtualenv -p python3 " + venv_tmp_dir
210213

211214
if check_os() == "Windows":
212-
activate_command = ".\\" + os.path.join(venv_tmp_dir, "Scripts", "activate")
215+
activate_command = os.path.join(venv_tmp_dir, "Scripts", "activate.bat")
213216
else:
214217
activate_command = ". " + os.path.join(venv_path, "bin", "activate")
215218

0 commit comments

Comments
 (0)