Dec-19-2023, 05:00 PM
(Dec-19-2023, 04:28 PM)snippsat Wrote: Now you are using Anaconda3 then most a environment be activated,(base)
is the default one.
Are a environment activated?
It's best is to make new environment and not use(base)
for this.
As you see here it goes over to a other version of Python that's not Anaconda.
/private/var/folders/rv/n6zb4_qs6ql1r8cc2gs7w8_w0000gn/T/pip-build-env-nqoa4iyp/overlay/lib/python3.11/sThis should of course not happen as you install to Anaconda,see the Path to Python 3.11 is different.
/Users/amirhosein/anaconda3/lib/python3.11/site-packages/pipExample is i use Miniconda(work the same as Anaconda) and then first active a environment then it works.
G:\div_code λ G:\miniconda3\Scripts\activate.bat tom_env # When a environment it has (name_of_env) G:\div_code (tom_env) λ pip install flask-mysqldb Collecting flask-mysqldb Downloading Flask_MySQLdb-2.0.0-py3-none-any.whl (4.9 kB) Collecting Flask>=1.0.4 Using cached flask-3.0.0-py3-none-any.whl (99 kB) Collecting mysqlclient>=2.2.0 Downloading mysqlclient-2.2.1-cp310-cp310-win_amd64.whl (202 kB) |████████████████████████████████| 202 kB 731 kB/s Collecting Jinja2>=3.1.2 Using cached Jinja2-3.1.2-py3-none-any.whl (133 kB) Collecting itsdangerous>=2.1.2 Using cached itsdangerous-2.1.2-py3-none-any.whl (15 kB) Collecting click>=8.1.3 Downloading click-8.1.7-py3-none-any.whl (97 kB) |████████████████████████████████| 97 kB 3.3 MB/s Collecting blinker>=1.6.2 Downloading blinker-1.7.0-py3-none-any.whl (13 kB) Collecting Werkzeug>=3.0.0 Downloading werkzeug-3.0.1-py3-none-any.whl (226 kB) |████████████████████████████████| 226 kB 6.4 MB/s Requirement already satisfied: colorama in g:\miniconda3\envs\tom_env\lib\site-packages (from click>=8.1.3->Flask>=1.0.4->flask-mysqldb) (0.4.4) Requirement already satisfied: MarkupSafe>=2.0 in g:\miniconda3\envs\tom_env\lib\site-packages (from Jinja2>=3.1.2->Flask>=1.0.4->flask-mysqldb) (2.0.1) Collecting MarkupSafe>=2.0 Downloading MarkupSafe-2.1.3-cp310-cp310-win_amd64.whl (17 kB) Installing collected packages: MarkupSafe, Werkzeug, Jinja2, itsdangerous, click, blinker, mysqlclient, Flask, flask-mysqldb Attempting uninstall: MarkupSafe Found existing installation: MarkupSafe 2.0.1 Uninstalling MarkupSafe-2.0.1: Successfully uninstalled MarkupSafe-2.0.1 Attempting uninstall: Jinja2 Found existing installation: Jinja2 3.0.3 Uninstalling Jinja2-3.0.3: Successfully uninstalled Jinja2-3.0.3 Successfully installed Flask-3.0.0 Jinja2-3.1.2 MarkupSafe-2.1.3 Werkzeug-3.0.1 blinker-1.7.0 click-8.1.7 flask-mysqldb-2.0.0 itsdangerous-2.1.2 mysqlclient-2.2.1 # Test G:\div_code (tom_env) λ python Python 3.10.1 | packaged by conda-forge | (main, Dec 22 2021, 01:34:40) [MSC v.1929 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> from flask_mysqldb import MySQL >>> # No error >>> exit()
How do I make a new environment ?