Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing Python Package abc

Tags:

python-2.7

I am trying to run someone's code and I hitting an issue with their imports

from abc import ABC, abstractmethod

I tried doing a pip install abc but that did not find any package named abc.

Has anyone used this package before? If so, was abc the correct package name to install? If not, what is the correct package name? Using Python 2.7.13

like image 480
Crackerman Avatar asked Sep 20 '18 12:09

Crackerman


People also ask

How do I install a Python package?

How do I Install a Specific Version of a Python Package? To install a specific version of a Python package you can use pip: pip install YourPackage==YourVersion . For example, if you want to install an older version of Pandas you can do as follows: pip install pandas==1.1. 3 .


2 Answers

Go to https://pypi.org/search/?q=abc

This queries all official registered python packages. It seems there a package abc which is orphened.

If someone else from your company or community wrote a package abc, there are two ways. Either yoy create a local repository and add abc there. or you install the package manually by creating a wheel file and install it with pip install

like image 163
Stefan Papp Avatar answered Sep 20 '22 13:09

Stefan Papp


For the record, I was able to search pypi and find a package that worked. I installed abcplus pip install abcplus and that allowed me to execute the import statement.

like image 31
Crackerman Avatar answered Sep 22 '22 13:09

Crackerman