Opened 6 years ago

Closed 5 years ago

#570 closed defect (fixed)

pip3

Reported by: rduivenvoorde Owned by: osgeo4w-dev@…
Priority: major Component: Package
Version: Keywords:
Cc:

Description

After installing bare qgis-dev package, there is a 'pip3' command available, but it does not seem to work?

The installed the python-pip3 package, but still nog pip:

C:\osgeo4w64\bin> pip3 install lxml Fatal error in launcher: Unable to create process using '"'

https://trac.osgeo.org/osgeo4w/wiki/ExternalPythonPackages

still tells: install via python get-pip.py

what is a working way? Happy to fix the wiki if needed.

Attachments (1)

error.png (30.7 KB ) - added by Andreas Müller 6 years ago.
Error Message when pip is called

Download all attachments as: .zip

Change History (18)

comment:1 by Andreas Müller, 6 years ago

i found that all python-executables in OSGeo4W/apps/Python36/Scripts have wrong shebangs (#!). There pathes point to python executables, that may do not exist. I used an editor (notepad++) and opened the exe files, at the bottom one can find the shebang string. These I changed to #!python3.exe.

Inside the OSGeo4w-Shell you have to call py3_env and then e.g. pip3 - without the path information it works!

A solution could be to build the executables with a different shebang. Don't know if this could be done easily?

Last edited 6 years ago by Andreas Müller (previous) (diff)

in reply to:  1 comment:2 by jef, 6 years ago

Replying to muellea:

Inside the OSGeo4w-Shell you have to call py3_env and then e.g. pip3 - without the path information it works!

Correct - and that's how it's intended to work.

comment:3 by Andreas Müller, 6 years ago

But only with a changed shebang inside the exe! That's the problem...

in reply to:  3 comment:4 by jef, 6 years ago

Replying to muellea:

But only with a changed shebang inside the exe! That's the problem...

Not if you call py3_env.bat upfront.

Last edited 6 years ago by jef (previous) (diff)

by Andreas Müller, 6 years ago

Attachment: error.png added

Error Message when pip is called

comment:5 by Andreas Müller, 6 years ago

see my attachment, same with pip3

comment:6 by jef, 6 years ago

call py3_env.bat not py3_env.bat

comment:7 by Andreas Müller, 6 years ago

unfortunately the same. Tried py3_env and call py3_env. In both cases i can start an interactive python-shell (python3), so environment is set, but pip3 refuses to start.

in reply to:  7 ; comment:8 by jef, 6 years ago

Replying to muellea:

unfortunately the same. Tried py3_env and call py3_env. In both cases i can start an interactive python-shell (python3), so environment is set, but pip3 refuses to start.

Not reproducable here:

run o-help for a list of available commands
C:\Windows\System32>call py3_env.bat

C:\Windows\System32>SET PYTHONPATH=

C:\Windows\System32>SET PYTHONHOME=C:\OSGEO4~1\apps\Python36

C:\Windows\System32>PATH C:\OSGEO4~1\apps\Python36;C:\OSGEO4~1\apps\Python36\Scripts;C:\OSGEO4~1\apps\Python27\Scripts;C:\OSGEO4~1\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\WBem

C:\Windows\System32>pip3

Usage:
  pip3 <command> [options]
...

in reply to:  8 comment:9 by Andreas Müller, 6 years ago

strange, i'll try with a fresh install...

in reply to:  8 comment:10 by Andreas Müller, 6 years ago

I did a fresh install and the error remains. The file pip3.exe contains a path to #!c:\qt\32\python\python.exe. Jef, are you sure this path doesn't exist on your computer?

comment:11 by jef, 6 years ago

I can confirm that \bin\pip3.exe has that path - but apps\Python36\Scripts\pip3.exe which should be before \bin in PATH has the correct path. Are you starting it explictly from bin?

comment:12 by Andreas Müller, 6 years ago

they all have the same path (shebang) here, pip3 in Scripts comes first in the path variable set by py3_env.bat, so this will execute, and no i'm not in bin. If I install python3 from python.org, the path (shebang) is set during install and points to whatever installation dir i use for python. But I think this is not a part in postinstall of the osgeo4w package, so path(shebang) remains.

Some executables, like jupiter.exe, point to c:\osgeo4w\bin\python3.exe which is correct for an unchanged installation directory.

By the way: the idea to change the shebang manually cames from a q/a on stackexchange

So, as written there, simply using python -m pip inside a pip.bat would do the job, too.

Last edited 6 years ago by Andreas Müller (previous) (diff)

in reply to:  8 ; comment:13 by hellik, 6 years ago

Replying to jef:

Replying to muellea:

unfortunately the same. Tried py3_env and call py3_env. In both cases i can start an interactive python-shell (python3), so environment is set, but pip3 refuses to start.

Not reproducable here:

run o-help for a list of available commands
C:\Windows\System32>call py3_env.bat

C:\Windows\System32>SET PYTHONPATH=

C:\Windows\System32>SET PYTHONHOME=C:\OSGEO4~1\apps\Python36

C:\Windows\System32>PATH C:\OSGEO4~1\apps\Python36;C:\OSGEO4~1\apps\Python36\Scripts;C:\OSGEO4~1\apps\Python27\Scripts;C:\OSGEO4~1\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\WBem

C:\Windows\System32>pip3

Usage:
  pip3 <command> [options]
...

tested here:

run o-help for a list of available commands
C:\>call py3_env.bat

C:\>SET PYTHONPATH=

C:\>SET PYTHONHOME=C:\OSGEO4~1\apps\Python36

C:\>PATH C:\OSGEO4~1\apps\Python36;C:\OSGEO4~1\apps\Python36\Scripts;{app};C:\OSGEO4~1\apps\Python27\Scripts;C:\OSGEO4~1\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\WBem;C:\OSGEO4~1\apps\msys\bin;C:\Program Files\R\R-3.4.4\bin\x64

C:\>pip3
Fatal error in launcher: Unable to create process using '"'

C:\>

ckecked in the OSGeo4W installer wizard, pip3 isn't installed.

comment:14 by Andreas Müller, 6 years ago

I didn't install pip package either. But pip is installed with the python3-core package, I think. Anyway, try python3 -m pip. This will start pip from site-sitepackages. The problem is with the exe files only.

comment:15 by Andreas Müller, 6 years ago

Ok, inside the python3-pip package the exe file pip.exe has a different path/shepang. It points to c:\osgeo4w\bin\python3. So, if this is the your installation folder, pip.exe should work. Unfortunately it doesn't work for me...

in reply to:  13 comment:16 by hellik, 6 years ago

Replying to hellik:

tested here:

run o-help for a list of available commands
C:\>call py3_env.bat

C:\>SET PYTHONPATH=

C:\>SET PYTHONHOME=C:\OSGEO4~1\apps\Python36

C:\>PATH C:\OSGEO4~1\apps\Python36;C:\OSGEO4~1\apps\Python36\Scripts;{app};C:\OSGEO4~1\apps\Python27\Scripts;C:\OSGEO4~1\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\WBem;C:\OSGEO4~1\apps\msys\bin;C:\Program Files\R\R-3.4.4\bin\x64

C:\>pip3
Fatal error in launcher: Unable to create process using '"'

C:\>

ckecked in the OSGeo4W installer wizard, pip3 isn't installed.

now installed pip3 via the OSGeo4W-installation wizard:

run o-help for a list of available commands
C:\>call py3_env.bat

C:\>SET PYTHONPATH=

C:\>SET PYTHONHOME=C:\OSGEO4~1\apps\Python36

C:\>PATH C:\OSGEO4~1\apps\Python36;C:\OSGEO4~1\apps\Python36\Scripts;{app};C:\OSGEO4~1\apps\Python27\Scripts;C:\OSGEO4~1\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\WBem;C:\OSGEO4~1\apps\msys\bin;C:\Program Files\R\R-3.4.4\bin\x64

C:\>pip3

Usage:
  pip3 <command> [options]

Commands:
  install                     Install packages.
  download                    Download packages.
  uninstall                   Uninstall packages.
  freeze                      Output installed packages in requirements format.
  list                        List installed packages.
  show                        Show information about installed packages.
  check                       Verify installed packages have compatible dependencies.
  config                      Manage local and global configuration.
  search                      Search PyPI for packages.
  wheel                       Build wheels from your requirements.
  hash                        Compute hashes of package archives.
  completion                  A helper command used for command completion.
  help                        Show help for commands.

General Options:
  -h, --help                  Show help.
  --isolated                  Run pip in an isolated mode, ignoring environment variables and user configuration.
  -v, --verbose               Give more output. Option is additive, and can be used up to 3 times.
  -V, --version               Show version and exit.
  -q, --quiet                 Give less output. Option is additive, and can be used up to 3 times (corresponding to
                              WARNING, ERROR, and CRITICAL logging levels).
  --log <path>                Path to a verbose appending log.
  --proxy <proxy>             Specify a proxy in the form [user:passwd@]proxy.server:port.
  --retries <retries>         Maximum number of retries each connection should attempt (default 5 times).
  --timeout <sec>             Set the socket timeout (default 15 seconds).
  --exists-action <action>    Default action when a path already exists: (s)witch, (i)gnore, (w)ipe, (b)ackup,
                              (a)bort).
  --trusted-host <hostname>   Mark this host as trusted, even though it does not have valid or any HTTPS.
  --cert <path>               Path to alternate CA bundle.
  --client-cert <path>        Path to SSL client certificate, a single file containing the private key and the
                              certificate in PEM format.
  --cache-dir <dir>           Store the cache data in <dir>.
  --no-cache-dir              Disable the cache.
  --disable-pip-version-check
                              Don't periodically check PyPI to determine whether a new version of pip is available for
                              download. Implied with --no-index.
  --no-color                  Suppress colored output

it works as expected

comment:17 by jef, 5 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.