Khi tôi cố gắng kích hoạt virtualenv của mình từ GIT bash mingw32 Tôi không nhận được phản hồi mong đợi.Không thể kích hoạt virtualenv trong GIT bash mingw32 cho Windows
LƯU Ý: py
là thư mục cho các dự án Python trong thư mục Google Drive của tôi. hy
là thư mục virtualenv được tạo khi tôi chạy virtualenv --distribute hy
.
[email protected] ~/Google Drive/py/hy
$ Scripts/activate
Vì vậy, bạn thấy, không có hy vọng (hy) xuất hiện trước [email protected] ~/Google Drive/py/hy
[email protected] ~/Google Drive/py/hy
$ Scripts/activate.bat
Scripts/activate.bat: line 1: @echo: command not found
Scripts/activate.bat: line 4: syntax error near unexpected token `('
Scripts/activate.bat: line 4: `if not defined PROMPT ('
Và khi nhắm mục tiêu tên tập tin thực tế activate.bat
tôi nhận được thông báo lỗi. Sau đó, tôi thử ngừng hoạt động để xem điều gì xảy ra vì tôi nghĩ có lẽ virtualenv đã được kích hoạt nhưng bị ẩn.
[email protected] ~/Google Drive/py/hy
$ Scripts/deactivate.bat
Scripts/deactivate.bat: line 1: @echo: command not found
Scripts/deactivate.bat: line 3: syntax error near unexpected token `('
Scripts/deactivate.bat: line 3: `if defined _OLD_VIRTUAL_PROMPT ('
[email protected] ~/Google Drive/py/hy
$ Scripts/deactivate
sh.exe": Scripts/deactivate: No such file or directory
Bất kỳ ý tưởng nào?
Wow cảm ơn bạn. Nó đã làm việc. Thật tốt. –
Tính năng này chỉ khả dụng trên virtualenv 1.7.1 trở lên. –
Bạn cần cài đặt riêng 'virtualenv' để làm việc này. Python 3 được xây dựng trong lệnh 'python -m venv' sẽ không tạo ra cùng một kịch bản' activate'. – BenjaminGolder