Skip to content

AttributeError: 'NoneType' object has no attribute 'startswith' #8651

Answered by rokm
suchmememanyskill asked this question in Help
Discussion options

You must be logged in to vote

Everyday we learn something new; unfortunately around here, that something usually translates into something horrible...

As the traceback suggests, the problem is that the path list passed to PyiFrozenImport.find_spec contains a None, so this part raises an error:

for p in path:
if not p.startswith(SYS_PREFIX):
continue

We should probably add a guard against that, similarly to how built-in finders also guard against non-string entries (e.g., here).


But how did we end up with None in that list in the first place?

It turns out that the problem is indeed a self-inflicted one, and boi…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@suchmememanyskill
Comment options

@suchmememanyskill
Comment options

@rokm
Comment options

Answer selected by suchmememanyskill
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants