我將帶有 /venv 的 Django 項(xiàng)目(mysite)重新定位到另一臺(tái)計(jì)算機(jī)。在第一臺(tái)電腦上它運(yùn)行良好。'dotenv' 模塊安裝在哪里。在 PyCharm 中,我將項(xiàng)目解釋器設(shè)置為:Python 3.7 (mysite) C:\Users\User\mysite\venv\Scripts\python.exe但是新計(jì)算機(jī)中的“python manage.py runserver”會(huì)引發(fā):ModuleNotFoundError: No module named 'dotenv'但在 ../mysite/venv/Scripts 中存在文件 dotenv.exe。還有 sobfolder ../venv/lib/site-packages/dotenv/ 。在 PyCharm-Settings-Project Interpreter 中的包列表中存在 python-dotenv 0.14.0好的。我嘗試通過 pip 安裝 dotenv,但它引發(fā)錯(cuò)誤: C:\Users\User\mysite\mysite>pip install dotenvCollecting dotenv Using cached https://files.pythonhosted.org/packages/e2/46/3754073706e31670eed18bfa8a879305b56a471db15f20523c2427b10078/dotenv-0.0.5.tar.gz Complete output from command python setup.py egg_info: Command "python setup.py egg_info" failed with error code 1 in C:\Temp\pip-wheel-4a1x88l2\distribute\ Traceback (most recent call last): File "C:\Users\User\Anaconda3\lib\site-packages\setuptools\installer.py", line 126, in fetch_build_egg subprocess.check_call(cmd) File "C:\Users\User\Anaconda3\lib\subprocess.py", line 347, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['C:\\Users\\User\\Anaconda3\\python.exe', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', 'C:\\Temp\\tmpz_ip4m3r', '--quiet', 'distribute']' returned non-zero exit status 1. The above exception was the direct cause of the following exception: Traceback (most recent call last): File "<string>", line 1, in <module> File "C:\Temp\pip-install-07by3weo\dotenv\setup.py", line 23, in <module> scripts=['scripts/dotenv'] File "C:\Users\User\Anaconda3\lib\site-packages\setuptools\__init__.py", line 152, in setup _install_setup_requires(attrs) File "C:\Users\User\Anaconda3\lib\site-packages\setuptools\__init__.py", line 147, in _install_setup_requires dist.fetch_build_eggs(dist.setup_requires)我嘗試這樣做:pip install --upgrade setuptools但沒有幫助怎么解決呢?
使用 /venv 將項(xiàng)目遷移到另一臺(tái) PC 找不到“dotenv”模塊并且無法安裝它
人到中年有點(diǎn)甜
2023-07-18 16:36:47