Tag Archives: pip3

Error reporting when PIP3 installs pycrypto

Error reporting when installing pycrypto with PIP3 under Windows:

 

Cause of problem:

Pycrypto, pycryptodome and crypto are one thing. Crypto is named pycrypto on python. It is a third-party library, but it has stopped updating for three years, so it is not recommended to install this library
as like as two peas, pycryptodome came in at the time. It is an extension of pycrypto, which is exactly the same as pycrypto. p>

 

Solution:

Step 1:

    pip3   install pycryptodome

Step 2:
    There is a problem importing the module when using it. At this time, you can perfectly solve this problem by modifying the name of a folder,
    Python \ Python 36 \ lib \ site packages, find this path. There is a folder called crypto below. Change lowercase C to uppercase C

Error in PIP3 execution of multi version Python by windows: module ‘enum’ has no attribute ‘intflag’?

Geeks, please accept the hero post of 2021 Microsoft x Intel hacking contest>>>

summary :

This machine is equipped with python2.7 and python3.6. There is no problem when executing PIP and PIP2. When executing PIP3, you will be prompted:

C:\Users\>pip3
Traceback (most recent call last):
  File "e:\python36\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "e:\python36\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "E:\Python36\Scripts\pip3.exe\__main__.py", line 2, in <module>
  File "e:\python36\lib\re.py", line 142, in <module>
    class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'

reason:

English: This is likely caused by the package enum34. Since Python 3.4 there’s a standard library enum module, so you should install enum34, which is no longer compatible with the enum in the standard library since enum.intflag was added in Python 3.6

English: this may be caused by the enum34 package. Because there is a standard library enumeration module in Python 3.4, you should uninstall enum34, which is no longer compatible with enumerations in the standard library because enumerations. Intflag was added in Python 3.6

solutions:

pip uninstall enum34

#Uninstall enum34

After unloading, PIP3 was executed successfully. It took most of the day yesterday to solve the problem

C:\Users>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.

How to Solve pip3 ImportError: cannot import name ‘main’

In Ubuntu, after upgrading PIP3, there is an error of importerror: cannot import name ‘main’ when using PIP3. This article describes how to correct this error, pro test effective

Install python3:

sudo apt install python3

Install PIP3:

sudo apt install python3-pip

Upgrade PIP3:

python3 -m pip install –upgrade pip

Then when using PIP3 to install other modules, the error of importerror: cannot import name ‘main’ appears

The fix is to modify the file/usr/bin/PIP3

Here is the original content of this document:

from pip import main  
if __name__ == '__main__':  
    sys.exit(main()) 

Obviously, the main function was modified after PIP3 upgrade

Now modify this file as follows:

from pip import __main__  //must modify
if __name__ == '__main__':  
    sys.exit(__main__._main())//add __main__._

After saving, and then using PIP3, everything is normal

~$ pip3 –version
pip 19.0.3 from /home/xinlin/.local/lib/python3.6/site-packages/pip (python 3.6)

I don’t know why, when installing python3, the version of the built-in PIP3 is so low. If you change it to a higher version, many people won’t face this problem

another method is to reconstruct the symbolic connection of/usr/bin/PIP3

Using python3 – M pip or python3 – M site — user base, you can see where PIP3 is installed and rebuild the symbolic connection (How to create symbolic links)