using pip3: module importlib._bootstrap has no attribute SourceFileLoader
Faced the same problem. I think this is because python3.6
and pip3
were installed from different sources.
I suggest using python's inbuilt facility to install pip i.e
python3 -m ensurepip --upgrade
This should install pip3
and pip3.x
where x in python3.x
.
Same works for python2
also.
importlib._bootstrap' has no attribute 'SourceLoader'
mmm there might be a bug there looking at the source code:
if sys.version_info[:2] < (3, 1):
bytecode = imp.get_magic() + struct.pack("<i", 0)
bytecode += marshal.dumps(compile(source_code, compile_filename, "exec"))
elif sys.version_info[:2] < (3, 4):
bytecode = imp.get_magic() + struct.pack("<ii", 0, 0)
bytecode += marshal.dumps(compile(source_code, compile_filename, "exec"))
else:
loader = importlib._bootstrap.SourceLoader()
code = loader.source_to_code(source_code, '<string>')
bytecode = importlib._bootstrap._code_to_bytecode(code, mtime=0, source_size=0)
Can you try to replace that line with:
loader = importlib._bootstrap_external.SourceLoader()
If that works then try using a lesser version than 3.5 and submit a bug in their github issue page.
Related Topics
How to Use 'Subprocess' Command With Pipes
Standard_Init_Linux.Go:178: Exec User Process Caused "Exec Format Error"
Get the Olson Tz Name For the Local Timezone
How to Iterate Through Two Lists in Parallel
How to Profile a Python Script
How to Group Dataframe Rows into List in Pandas Groupby
How to Type Hint a Method With the Type of the Enclosing Class
Adding a Method to an Existing Object Instance
What's With the Integer Cache Maintained by the Interpreter
Download Large File in Python With Requests
Imagemagick Not Authorized to Convert Pdf to an Image
Linux Command-Line Call Not Returning What It Should from Os.System
Return Value of X = Os.System(..)
Why Is Using 'Eval' a Bad Practice
Convert Columns into Rows With Pandas
Tkinter Assign Button Command in a For Loop With Lambda
Is It Pythonic to Use List Comprehensions For Just Side Effects