zodiac
zodiac

Reputation: 301

Making python package

I am reading the following tutorial about making a python package.

https://www.tutorialsteacher.com/python/python-package

I prepared everything like described on this page and the installation mentioned in the end works.

But what is very confusing, when renaming the folder from mypackage to abc and also changing the lines containing mypackage in setup.py to abc. I get the following error when i try to install with pip3 install abc

Fatal Python error: init_sys_streams: can't initialize sys standard streams Traceback (most recent call last): File "/home/.../anaconda3/lib/python3.7/io.py", line 72, in AttributeError: module 'abc' has no attribute 'ABCMeta' Aborted (core dumped)

And when changing the name to powerspectrum I get the following error:

ERROR: Could not find a version that satisfies the requirement powerspectrum (from versions: none) ERROR: No matching distribution found for powerspectrum.

But if I use as package name for example, powerspec everything works again like described in the tutorial. But somehow I am missing something. Are there protected names or are there rules how I have to choose package names? Or what else is the error I get related to?

Upvotes: 0

Views: 207

Answers (1)

Taxel
Taxel

Reputation: 4197

abc is a module defined by Python itself (stands for abstract base class). ABCMeta is part of this module. You apparently cannot use this already defined name as your package name.

Upvotes: 1

Related Questions