Issue
I am using Mac M1 now, when I am trying to import lxml in my python code, it shows below:
I've tried
my Python version is : Python 3.9.12
Solution
The main reason Spyder can't find 'lxml' is I used standalone Spyder, in order to fix this, I have to use a separate environment.
1 - Follow below article to create a new virtual environment https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/#creating-a-virtual-environment
2 - Follow below article to install necessary packages in the new environment, which link to Spyder IDE later, all issues will be fixed. https://github.com/spyder-ide/spyder/wiki/Working-with-packages-and-environments-in-Spyder#installing-packages-into-the-same-environment-as-spyder
Answered By - Sky
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.