question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pipenv run <executable> doesn't find executable that are in my PATH

See original GitHub issue

I upgraded pipenv to 2018.05.18 today from an older build (might have been 10.1.0) on my windows 10 machine, and now I’m having trouble using pipenv run to invoke executables I have in my PATH. It seems pipenv run doesn’t resolve anything in my PATH.

For example, I have my IDE atom in my path and invoke it as pipenv run atom which worked fine before I updated pipenv on my system.

After the update, I now get this error:

$ pipenv run atom
The system cannot find the path specified.

(I also see the same behavior trying to pipenv run <alias> on any alias I have defined in my .bashrc.)

$ python -m pipenv.help output

Pipenv version: '2018.05.18'

Pipenv location: 'C:\\Users\\user01\\AppData\\Local\\Programs\\Python\\Python36\\lib\\site-packages\\pipenv'

Python location: 'C:\\Users\\user01\\AppData\\Local\\Programs\\Python\\Python36\\python.exe'

Other Python installations in PATH:

  • 3.6: C:\Users\user01\AppData\Local\Programs\Python\Python36\python.exe

  • 3.6.5: C:\Users\user01\AppData\Local\Programs\Python\Python36\python.exe

  • 3.6.5: C:\Windows\py.exe

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.6.5',
 'os_name': 'nt',
 'platform_machine': 'AMD64',
 'platform_python_implementation': 'CPython',
 'platform_release': '10',
 'platform_system': 'Windows',
 'platform_version': '10.0.10586',
 'python_full_version': '3.6.5',
 'python_version': '3.6',
 'sys_platform': 'win32'}

System environment variables:

  • ACLOCAL_PATH
  • ALLUSERSPROFILE
  • ANSICON
  • ANSICON_DEF
  • APPDATA
  • COMMONPROGRAMFILES
  • COMPUTERNAME
  • COMSPEC
  • CONFIG_SITE
  • C_EM64T_REDIST11
  • COMMONPROGRAMFILES(X86)
  • COMMONPROGRAMW6432
  • CONEMUANSI
  • CONEMUANSILOG
  • CONEMUARGS2
  • CONEMUARGS
  • CONEMUBACKHWND
  • CONEMUBASEDIR
  • CONEMUBUILD
  • CONEMUCONFIG
  • CONEMUDIR
  • CONEMUDRAWHWND
  • CONEMUDRIVE
  • CONEMUHWND
  • CONEMUHOOKS
  • CONEMUPID
  • CONEMUPALETTE
  • CONEMUSERVERPID
  • CONEMUTASK
  • CONEMUWORKDIR
  • CONEMUWORKDRIVE
  • DISPLAY
  • EXEPATH
  • FSHARPINSTALLDIR
  • HOME
  • HOMEDRIVE
  • HOMEPATH
  • HOSTNAME
  • INFOPATH
  • LANG
  • LOCALAPPDATA
  • LOGONSERVER
  • MANPATH
  • MINGW_CHOST
  • MINGW_PACKAGE_PREFIX
  • MINGW_PREFIX
  • MSYSTEM
  • MSYSTEM_CARCH
  • MSYSTEM_CHOST
  • MSYSTEM_PREFIX
  • NUMBER_OF_PROCESSORS
  • OLDPWD
  • ORIGINAL_PATH
  • ORIGINAL_TEMP
  • ORIGINAL_TMP
  • OS
  • ONEDRIVE
  • PATH
  • PATHEXT
  • PIPENV_VENV_IN_PROJECT
  • PKG_CONFIG_PATH
  • PLINK_PROTOCOL
  • PROCESSOR_ARCHITECTURE
  • PROCESSOR_IDENTIFIER
  • PROCESSOR_LEVEL
  • PROCESSOR_REVISION
  • PROGRAMFILES
  • PS1
  • PSMODULEPATH
  • PUBLIC
  • PWD
  • PROGRAMDATA
  • PROGRAMFILES(X86)
  • PROGRAMW6432
  • RUBYOPT
  • SESSIONNAME
  • SHELL
  • SHLVL
  • SNOW_INVENTORY_HOME
  • SSH_AGENT_PID
  • SSH_ASKPASS
  • SSH_AUTH_SOCK
  • SSL_CERT_FILE
  • SYSTEMDRIVE
  • SYSTEMROOT
  • TEMP
  • TERM
  • TMP
  • TMPDIR
  • UATDATA
  • USERDNSDOMAIN
  • USERDOMAIN
  • USERDOMAIN_ROAMINGPROFILE
  • USERNAME
  • USERPROFILE
  • VBOX_MSI_INSTALL_PATH
  • VS140COMNTOOLS
  • WINDIR
  • _
  • USERDEV
  • USERZEN
  • SNOW_AGENT
  • PYTHONDONTWRITEBYTECODE
  • PIP_PYTHON_PATH

Pipenv–specific environment variables:

  • PIPENV_VENV_IN_PROJECT: 1

Debug–specific environment variables:

  • PATH: C:\Users\user01\bin;C:\Users\user01\AppData\Local\Programs\Git\mingw64\bin;C:\Users\user01\AppData\Local\Programs\Git\usr\local\bin;C:\Users\user01\AppData\Local\Programs\Git\usr\bin;C:\Users\user01\AppData\Local\Programs\Git\usr\bin;C:\Users\user01\AppData\Local\Programs\Git\cmd;C:\Program Files\ConEmu\ConEmu\Scripts;C:\Program Files\ConEmu;C:\Program Files\ConEmu\ConEmu;C:\Program Files (x86)\Common Files\Intel\Shared Files\cpp\bin\Intel64;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files\SASHome\x86\Secure\ccme4;C:\Program Files\SASHome\Secure\ccme4;C:\Program Files (x86)\WinSCP;C:\Program Files (x86)\PuTTY;C:\Program Files\MySQL\MySQL Server 5.7\bin;C:\Apache24\bin;C:\php56;C:\HashiCorp\Vagrant\bin;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\Program Files\nodejs;C:\Users\user01\AppData\Roaming\Python\Python36\Scripts;C:\Users\user01\AppData\Local\Programs\Git\usr\bin;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio;C:\Users\user01\AppData\Local\Programs\Python\Python36\Scripts;C:\Users\user01\AppData\Local\Programs\Python\Python36;C:\Ruby22\bin;C:\Users\user01\AppData\Local\atom\bin;C:\Users\user01\bin\zatit;C:\Program Files\PostgreSQL\9.6\bin;C:\Users\user01\bin;C:\Users\user01\AppData\Roaming\npm;C:\Users\user01\AppData\Local\Programs\Git\usr\bin\vendor_perl;C:\Users\user01\AppData\Local\Programs\Git\usr\bin\core_perl
  • SHELL: C:\Users\user01\AppData\Local\Programs\Git\usr\bin\bash.exe
  • LANG: en_US.UTF-8
  • PWD: C:/dev/path_resolve_pipenv2018.05.18

Contents of Pipfile (‘C:\dev\path_resolve_pipenv2018.05.18\Pipfile’):

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]

[dev-packages]

[requires]
python_version = "3.6"

Contents of Pipfile.lock (‘C:\dev\path_resolve_pipenv2018.05.18\Pipfile.lock’):

{
    "_meta": {
        "hash": {
            "sha256": "415dfdcb118dd9bdfef17671cb7dcd78dbd69b6ae7d4f39e8b44e71d60ca72e7"
        },
        "pipfile-spec": 6,
        "requires": {
            "python_version": "3.6"
        },
        "sources": [
            {
                "name": "pypi",
                "url": "https://pypi.org/simple",
                "verify_ssl": true
            }
        ]
    },
    "default": {},
    "develop": {}
}


Expected result

When <executable> is in my PATH, running pipenv run <executable> would resolve and run <executable> within the virtual environment.

Actual result

When <executable> is in my PATH, running pipenv run <executable> yields The system cannot find the path specified.

Steps to replicate

I’m on windows 10. I guess this could be OS-related.

  1. Open shell. I have replicated this on Git bash (for windows) and regular PowerShell.
  2. Create an empty directory and cd into.
  3. $ pipenv install --three
  4. Have a PATH environment variable that inludes an exectuable, e.g. C:\Users\user01\AppData\Local\atom\bin (that contains an executable, here: atom)
  5. Verify you can trigger executable from shell ($ atom)
  6. Now try $ pipenv run atom
  7. Get error message The system cannot find the path specified.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
uranusjrcommented, May 31, 2018

Yup that’s the problem I was talking about. Pipenv currently doesn’t check for all possible executable extensions, only a few selected ones. We should instead check for entries in PATHEXT. I’ll put up a fix in a few days.

0reactions
techalchemycommented, May 31, 2018

We were doing this for windows, btw.

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - Running pipenv environment via $PATH symlink to ...
Installed pyinstaller as dev dependency with pipenv install --dev ... [project path]/dist/appname executable into my ~/.bin directory.
Read more >
Configure a Pipenv environment | PyCharm Documentation
If the pipenv executable is not found, follow the pipenv installation procedure to discover the executable path, and then paste it in the...
Read more >
"which" can't find location of executable even though it runs
This confused me so I typed 'which conda' to see if I could find what executable is being run, but when I do...
Read more >
Frequently Encountered Pipenv Problems - Read the Docs
This is usually a result of mixing Pipenv with system packages. We strongly recommend installing Pipenv in an isolated environment. Uninstall all existing ......
Read more >
Using Python's pip to Manage Your Projects' Dependencies
Notice that you use python3 -m to run pip . The -m switch tells Python to run a module as an executable of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found