How to install safe_lxml

Microsoft Windows [Version 10.0.19043.1645]
(c) Microsoft Corporation. All rights reserved.

E:\New Project\edx-platform-master>python --version
Python 3.10.4

E:\New Project\edx-platform-master>manage.py runserver
Traceback (most recent call last):
File “E:\New Project\edx-platform-master\manage.py”, line 20, in
from safe_lxml import defuse_xml_libs
ModuleNotFoundError: No module named ‘safe_lxml’

E:\New Project\edx-platform-master>python manage.py runserver
Traceback (most recent call last):
File “E:\New Project\edx-platform-master\manage.py”, line 20, in
from safe_lxml import defuse_xml_libs
ModuleNotFoundError: No module named ‘safe_lxml’

E:\New Project\edx-platform-master>pypip install lxml
‘pypip’ is not recognized as an internal or external command,
operable program or batch file.

E:\New Project\edx-platform-master>pip install lxml
Collecting lxml
Downloading lxml-4.8.0-cp310-cp310-win_amd64.whl (3.6 MB)
---------------------------------------- 3.6/3.6 MB 716.5 kB/s eta 0:00:00
Installing collected packages: lxml
Successfully installed lxml-4.8.0
WARNING: You are using pip version 22.0.4; however, version 22.1 is available.
You should consider upgrading via the ‘C:\Users\Muhammad Usama\AppData\Local\Programs\Python\Python310\python.exe -m pip install --upgrade pip’ command.

E:\New Project\edx-platform-master>python manage.py runserver
Traceback (most recent call last):
File “E:\New Project\edx-platform-master\manage.py”, line 20, in
from safe_lxml import defuse_xml_libs
ModuleNotFoundError: No module named ‘safe_lxml’

E:\New Project\edx-platform-master>install --upgrade pip
‘install’ is not recognized as an internal or external command,
operable program or batch file.

E:\New Project\edx-platform-master>pip --upgrade

Usage:
pip [options]

no such option: --upgrade

E:\New Project\edx-platform-master>pip install --upgrade
ERROR: You must give at least one requirement to install (see “pip help install”)
WARNING: You are using pip version 22.0.4; however, version 22.1 is available.
You should consider upgrading via the ‘C:\Users\Muhammad Usama\AppData\Local\Programs\Python\Python310\python.exe -m pip install --upgrade pip’ command.

E:\New Project\edx-platform-master>pip install lxml
Requirement already satisfied: lxml in c:\users\muhammad usama\appdata\local\programs\python\python310\lib\site-packages (4.8.0)
WARNING: You are using pip version 22.0.4; however, version 22.1 is available.
You should consider upgrading via the ‘C:\Users\Muhammad Usama\AppData\Local\Programs\Python\Python310\python.exe -m pip install --upgrade pip’ command.

E:\New Project\edx-platform-master>pip install safe_lxml
ERROR: Could not find a version that satisfies the requirement safe_lxml (from versions: none)
ERROR: No matching distribution found for safe_lxml
WARNING: You are using pip version 22.0.4; however, version 22.1 is available.
You should consider upgrading via the ‘C:\Users\Muhammad Usama\AppData\Local\Programs\Python\Python310\python.exe -m pip install --upgrade pip’ command.

E:\New Project\edx-platform-master>python manage.py runserver
Traceback (most recent call last):
File “E:\New Project\edx-platform-master\manage.py”, line 20, in
from safe_lxml import defuse_xml_libs
ModuleNotFoundError: No module named ‘safe_lxml’

E:\New Project\edx-platform-master>python -m pip install --upgrade pip
Requirement already satisfied: pip in c:\users\muhammad usama\appdata\local\programs\python\python310\lib\site-packages (22.0.4)
Collecting pip
Downloading pip-22.1-py3-none-any.whl (2.1 MB)
---------------------------------------- 2.1/2.1 MB 753.3 kB/s eta 0:00:00
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 22.0.4
Uninstalling pip-22.0.4:
Successfully uninstalled pip-22.0.4
Successfully installed pip-22.1

E:\New Project\edx-platform-master>python manage.py runserver
Traceback (most recent call last):
File “E:\New Project\edx-platform-master\manage.py”, line 20, in
from safe_lxml import defuse_xml_libs
ModuleNotFoundError: No module named ‘safe_lxml’

E:\New Project\edx-platform-master>pip install safe_lxml
ERROR: Could not find a version that satisfies the requirement safe_lxml (from versions: none)
ERROR: No matching distribution found for safe_lxml

E:\New Project\edx-platform-master>pip install safe_lxml
ERROR: Could not find a version that satisfies the requirement safe_lxml (from versions: none)
ERROR: No matching distribution found for safe_lxml

E:\New Project\edx-platform-master>python manage.py runserver
Traceback (most recent call last):
File “E:\New Project\edx-platform-master\manage.py”, line 20, in
from safe_lxml import defuse_xml_libs
ModuleNotFoundError: No module named ‘safe_lxml’

E:\New Project\edx-platform-master>python safe_lxml --v
python: can’t open file ‘E:\New Project\edx-platform-master\safe_lxml’: [Errno 2] No such file or directory

E:\New Project\edx-platform-master>safe_lxml --version
‘safe_lxml’ is not recognized as an internal or external command,
operable program or batch file.

E:\New Project\edx-platform-master>

Hello @Muhammad_Usama, It looks like you are trying to make edx-platform run the manage command in a Windows command line. This might not be imposible, but it will be very hard to achieve. Most developers working on this project tend to do so using linux environments and most recently also docker.

Currently the best way to get started and run the code is to use the tutor project.

To the specific point on how to install safe_lxml then the answer is that it is not so much an external dependency, but more a dependency whose code is also located at the edx-platform repo.
To install it, you would go with:

pip install -e common/lib/safe_lxml

from the root of the project, but as this will not solve the issue of running the manage command.