Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@ChuckHend
Copy link

PackageNotFoundError exists in the 'exc' module rather than 'exceptions'. 'exceptions' does not exist.

@scanny
Copy link
Owner

scanny commented Sep 20, 2017

Were you having a problem with this? exceptions is a mapping (to exc) defined in pptx/__init__.py for reasons I can't quite remember, something like the exceptions name was a Python global or something.

https://github.com/scanny/python-pptx/blob/master/pptx/__init__.py#L10

@ChuckHend
Copy link
Author

ChuckHend commented Sep 20, 2017

I was getting a module not found error on that line, I overlooked the mapping to exc though. This PR fixed the problem for me but maybe the issue was actually something with my local environment. Looks like its not a problem on my windows machine, only a problem on my mac, will look at it more tonight.

@scanny
Copy link
Owner

scanny commented Sep 20, 2017

Yes, now that you mention it, I get that same error sometimes when things are not right somewhere else. I don't think I've narrowed down when that is, maybe when I haven't entered the virtual machine or something. If you can look out for specifically what fixes it (without the patch) maybe we can track it down and put in something useful by way of an error message or something.

Could be what happens if pptx is not found in sys.path; I seem to remember something vaguely like that. Maybe if you run certain development operations when you're not in the project directory and don't have python-pptx installed in "editable" (i.e. pip install -e ...) mode.

@ChuckHend
Copy link
Author

Going to close this PR. Found this nice surprise in my __init__.py
#import pptx.exc as exceptions
import sys
#sys.modules['pptx.exceptions'] = exceptions
Uncommenting those lines fixed the problem...now to figure out how those got commented out in the first place.

@ChuckHend ChuckHend closed this Sep 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.