DreamCobbler / fiction-dl

A content downloader, capable of retrieving works of (fan)fiction from the web and saving them in a few common file formats.
GNU General Public License v3.0
45 stars 2 forks source link

AddToPATH, GetPackageDirectory #5

Closed betsybugaboo closed 4 years ago

betsybugaboo commented 4 years ago

I just installed the latest release, and now when I try to do anything I get the following error message:

Traceback (most recent call last): File "__main__.py", line 34, in <module> from Utilities.Filesystem import AddToPATH, GetPackageDirectory ImportError: cannot import name 'GetPackageDirectory' from 'Utilities.Filesystem' (C:\Users\Betsybugaboo\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\fiction_dl\Utilities\Filesystem.py)

What do I need to do to resolve this?

DreamCobbler commented 4 years ago

Try version 1.6.2, I've posted it just now.

"AddToPATH" function was imported from a wrong module (from Utilities.Filesystem instead of dreamy_utilities.Filesystem, which is a separate package). Weirdly, that's not the problem your log points at - it seems to import this particular function correctly. I've fixed it in 1.6.1, posted some ten minutes ago.

"GetPackageDirectory" ought to be imported correctly. Still, I've put it inside a "try" block and now fiction-dl either imports it from Utilities.Filesystem or fiction_dl.Utilities.Filesystem, depending on which one works. (The whole code adding the package directory to the PATH variable should be executed only when the main.py file is executed directly, so this error shouldn't happen at all when you're running a package installed using a package manager - but still, this ought to solve it.)