Odd behavior after upgrading package with pip.

Posted by ben.key on 2018-05-07 20:29

I am seeing some very odd behavior with ActiveState ActivePython after using pip to install a package.

1. Install ActiveState ActivePython 3.6.

2. Run a Python script using the file association, that is just by calling the script itself. All is well in the universe.

3. Use pip to upgrade a package that is included in ActiveState ActivePython. For example, run the following command.

python -m pip install --upgrade pip

4. Run a Python script using the file association, that is just by calling the script itself. The universe blows up.

5. The following dialog box is displayed.

[ActivePython 3.6.0 Build 3600 (64-bit)]

Please wait while Windows configures ActivePython 3.6.0 Build 3600 (64-bit).

[Cancel]

6. This leads to a "The feature you are trying to use is on a network resource that is available" dialog box.

7. Since I have not idea what it is looking for, I hit cancel in this dialog box.

8. A "Fatal error during installation" message is displayed.

9. Focus returns to the command prompt.

10. The script fails to run.

The end result is that running a script by calling the script directly is completely broken. You have to uninstall ActivePython and reinstall it to get the just run script feature to work.

You are forced to put up with out of date packages since any attempt to upgrade an out of date package causes this to break.

grahams
ActiveState Staff
Tue, 2018-05-08 08:13

> python -m pip install --upgrade pip

This is fatal.
https://community.activestate.com/node/23235#comment-29826

(Taken from the previous post to make this a better Sticky post)

If you use that command, three new .exe files will appear in the Scripts folder.
- First, this is faulty design, and is asking for troubles with Sysadmins and Windows security. Executables do not belong in a scripts folder.
- Second, the naive pip update script blows away two required Python scripts that fix problems with the environment.
- Third, exe files load with a higher priority than batch files if both are found in the same folder. That prevents the existing batch files for pip from ensuring that the PYTHONLIB variable is loaded before pip is called.

You're going to get a broken implementation of pip if you use the upstream upgrade command.

ben.key | Tue, 2018-05-08 08:26

I tried upgrading other packages and purposely left the pip package alone. I get the same problem. I have essentially given up on upgrading existing packages and am only using pip to install new packages.

grahams
ActiveState Staff
Fri, 2018-05-11 07:54

There's a known issue with the old 3.6.0 version, and pip is mostly broken.

If you use one of the much newer 3.5.x releases, you'll only see a problem if you upgrade pip itself.
Or you can wait for a future 3.6.x release which might come later this year.

ben.key | Tue, 2018-05-15 21:33

I get the same exact results with ActivePython 3.5.

1. Install ActivePython 3.5.

2. Run two pip commands.

python3 -m pip install cx_Freeze --upgrade
python3 -m pip install conan --upgrade

3. Try to run Python script using script name only.

4. The universe blows up and I need to reinstall ActivePython to get the run using script name only feature to work again.

What the hell do I have to do to get this to work?

I am on the verge of abandoning ActivePython. The main reason I use it is for the pre-installed packages.

grahams
ActiveState Staff
Thu, 2018-05-17 16:33

Both of the modules use binary wheels. One of them fails to install it's binaries for win32api in the proper place for them. Unfortunately, since the site-packages folder has loading priority over the working Lib default folders, the update breaks the "import" call on Windows for everything.

This seems to be fairly common when installing wheels. There's a post on github with the exact solution for manually fixing the installation by moving some dlls to the folder where they need to be.
https://github.com/michaelgundlach/pyspeech/issues/23
See the solution from (mingzhi198 commented on 19 Feb 2017)