Dec-22-2019, 01:49 PM
(This post was last modified: Dec-22-2019, 01:49 PM by DreamingInsanity.)
I have done some more debugging. I removed pyenv entirely so the python installs were back to how they were before.
I reinstalled pip and lxml into python 3.8.
I opened up python in the terminal:
As soon as I try:
Why is python 3.8 trying to import a library from 3.6?
Last update - I have it fixed.
I tried installing lxml using the pip executables directly from the python directory. It was saying that lxml was already installed in python 3.6. (even though it was python 3.8 pip)
I then tried
The last thing I tried was removing lxml from python 3.6, so it would have to look elsewhere for lxml.
That did the trick.
I am still yet to know why python 3.8 was trying to import libraries from python 3.6.
I reinstalled pip and lxml into python 3.8.
I opened up python in the terminal:
Output:$ python3
Python 3.8.1 (v3.8.1:1b293b6006, Dec 18 2019, 14:08:53)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import lxml
>>>
Importing lxml is fine there are no errors.As soon as I try:
Output:>>> from lxml import etree
Error:Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name 'etree' from 'lxml'
However, I noticed this in the error:(//Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/lxml/__init__.py)
Why is python 3.8 trying to import a library from 3.6?
Last update - I have it fixed.
I tried installing lxml using the pip executables directly from the python directory. It was saying that lxml was already installed in python 3.6. (even though it was python 3.8 pip)
I then tried
sudo pip3 install lxml
which I feel like I have done before. Either way, it installed lxml yet the error didn't go away.The last thing I tried was removing lxml from python 3.6, so it would have to look elsewhere for lxml.
Output:>>> import lxml
>>> from lxml import etree
>>>
That did the trick.
I am still yet to know why python 3.8 was trying to import libraries from python 3.6.