由于未知原因无法使用 pipenv 安装 Django(但可以使用 pip)

Can't install Django using pipenv for unknown reason (but can using pip)

我不知道是什么导致了这个问题,我已经尝试卸载并从头开始重新安装所有东西,经过两天的尝试,我仍然无法解决这个问题。我真的需要一些专家的帮助。

我是不是漏掉了一些基本的东西?

在我的台式机上我是 运行 Windows 10,在我的笔记本电脑上我是 运行 Windows 7(专业版,SP1)。

在桌面上,我 pipenvinstall django==1.11pip freeze 显示 django==1.11 列出。在我的笔记本电脑上,使用 pipenvinstall django==1.10,但是 pip freeze 没有列出 django。当我检查 pipfile.lock 时,我看到 django 列在那里。

这是我笔记本电脑的日志,因此您可以看到我使用过的所有命令(以防我遗漏了一个):

PS C:\Project> pipenv install django==1.11

Creating a virtualenv for this project.
Using C:\Python27\python.exe to create virtualenv.
Running virtualenv with interpreter C:\Python27\python.exe
New python executable in C:\Project\Scri...
xe
Installing setuptools, pip, wheel...done.

Virtualenv location: C:\Project\
Installing django==1.10.
Collecting django==1.10
  Using cached Django-1.10-py2.py3-none-any.whl
Installing collected packages: django
Successfully installed django-1.10

Adding django==1.10 to Pipfile's [packages]
Locking [dev-packages] dependencies.
Locking [packages] dependencies.
Updated Pipfile.lock (93acb4)!

PS C:\Projects> cat pipfile

[[source]]

url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"

[dev-packages]
[packages]    
django = "==1.10"

PS C:\Project> cat pipfile.lock

{
    "_meta": {
        "hash": {
            "sha256": "92bc94ea06d9cf8e2f7b9ed1628d1036db1bce0bb20f920009e9f6dba093acb4"
        },
        "host-environment-markers": {
            "implementation_name": "cpython",
            "implementation_version": "0",
            "os_name": "nt",
            "platform_machine": "AMD64",
            "platform_python_implementation": "CPython",
            "platform_release": "7",
            "platform_system": "Windows",
            "platform_version": "6.1.7601",
            "python_full_version": "2.7.14",
            "python_version": "2.7",
            "sys_platform": "win32"
        },
        "pipfile-spec": 6,
        "requires": {},
        "sources": [
            {
                "name": "pypi",
                "url": "https://pypi.python.org/simple",
                "verify_ssl": true
            }
        ]
    },
    "default": {
        "django": {
            "hashes": [
                "sha256:9c60f4a801bf7c26bd6824c1062550c12c373344116703461c18cc258f8c9320",
                "sha256:46b868d68e5fd69dd9e05a0a7900df91786097e30b2aa6f065dd7fa3b22f7005"
            ],
            "version": "==1.10"
        }
    },
    "develop": {}
}

PS C:\Project> pip freeze

backports.shutil-get-terminal-size==1.0.0
certifi==2018.1.18
chardet==3.0.4
configparser==3.5.0
enum34==1.1.6
flake8==3.5.0
idna==2.6
mccabe==0.6.1
pathlib==1.0.1
pew==1.1.2
pipenv==9.0.3
psutil==5.3.1
pycodestyle==2.3.1
pyflakes==1.6.0
requests==2.18.4
shutilwhich==1.1.0
urllib3==1.22
virtualenv==15.1.0
virtualenv-clone==0.2.6

PS C:\Project> django-admin startporject 项目

The term 'django-admin' is not recognized as the name of a cmdlet, function, script file, or operable program. Check th
e spelling of the name, or if a path was included, verify that the path is correct and try again.

我试过禁用 Avast(每当我安装新软件包时它都会弹出 "hold on while we scan that" 通知)

我注意到日志开头的 Using cached Django-1.10-py2.py3-none-any.whl - 我应该尝试清除缓存(以防包损坏)并重试吗?

我是不是在做傻事?如果没有,我该如何着手找出问题所在以便解决?

听起来你还没有激活虚拟环境 - 尝试 pipenv shell 然后 django-admin ...