singmotor
singmotor

Reputation: 4180

Why doesn't this package work in python3?

I'm curious, for a small custom python package.

If I run the python file that imports and uses function from the package in python2, everything works fine. If I run the file in python3 though it fails importing functions from the package.

    from cust_package import this_function
ImportError: cannon import name 'this_function'

The functions in the package seem to be python3 compatible, and I used futurize on them just in case. Is the issue to do with some sort of labeling of the package/python version? The package is tiny, 2 .py files of ~8 functions each.

Appreciate the help, thanks!

Upvotes: 0

Views: 58

Answers (1)

Amarpreet Singh
Amarpreet Singh

Reputation: 2260

The default dir() mechanism behaves differently with different types of objects, as it attempts to produce the most relevant, rather than complete, information.

Dir documentation

There are available questions if you want all the available functions. here

Upvotes: 2

Related Questions