Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to create virtual environment to run the code locally #201

Closed
bambooom opened this issue Jun 15, 2023 · 7 comments · Fixed by #238
Closed

Failed to create virtual environment to run the code locally #201

bambooom opened this issue Jun 15, 2023 · 7 comments · Fixed by #238
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@bambooom
Copy link

I followed the instruction on this page: https://microsoft.github.io/AI-For-Beginners/etc/how-to-run
And I use this command to create a virtual environment, but failed:

➜ conda env create --name ai4beg --file .devcontainer/environment.yml
Collecting package metadata (repodata.json): done
Solving environment: failed

ResolvePackageNotFound: 
  - pytorch::torchvision=0.12.0
  - pytorch::torchtext=0.12.0
  - pytorch::torchdata=0.3.0

I've tried to move packages not found to under pip section of the environment.yml file.
And I tried to create the virtual environment again, it shows: with many conflicts:

...
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.
failed                                                                                                                                                                                                                    \  
Solving environment: / 
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.
failed                                                                                                                                                                                                                    |  

UnsatisfiableError: The following specifications were found to be incompatible with each other:

Output in format: Requested package -> Available versions

Package liblapack conflicts for:
scipy=1.6.2 -> liblapack[version='>=3.9.0,<4.0a0']
scikit-learn=0.24.2 -> numpy[version='>=1.19.5,<2.0a0'] -> liblapack[version='>=3.9.0,<4.0a0']
numpy=1.22.3 -> liblapack[version='>=3.9.0,<4.0a0']
......
......

Sorry, I'm not familiar with conda. How can I fix this? Or any other information I need to provide?

@alessandroseni
Copy link

Getting the same issue. Tried installing PyTorch in my directory but no help.

Was initially using Binder but now want to run the code locally.

@BethanyJep BethanyJep added bug Something isn't working good first issue Good for newcomers labels Jul 5, 2023
@wpfpizicai
Copy link

Getting the same issue.

@onewayheroic
Copy link

Same issue I meet

@lufonzi
Copy link

lufonzi commented Aug 5, 2023

I followed the same instructions at: https://microsoft.github.io/AI-For-Beginners/etc/how-to-run

This command took hours to execute and then failed after having successfully completed other steps: conda env create --name ai4beg --file .devcontainer/environment.yml

Error is as follows:

The conflict is caused by:
The user requested tokenizers==0.10.3
transformers 4.30.0 depends on tokenizers!=0.11.3, <0.14 and >=0.11.1

To fix this you could try to:

  1. loosen the range of package versions you've specified
  2. remove package versions to allow pip attempt to solve the dependency conflict

Pip subprocess error:
ERROR: Cannot install -r C:\Users\lufonzi\Python\AI-For-Beginners.devcontainer\requirements.txt (line 22) and tokenizers==0.10.3 because these package versions have conflicting dependencies.
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies

failed

CondaEnvException: Pip failed

@GanGral
Copy link

GanGral commented Aug 9, 2023

In .devcontainer\requirements.txt change the version of tokenizers to something higher than 0.11.3 but less than 0.14
I used 0.13.3.

those are the released versions for reference:
https://pypi.org/project/tokenizers/#history

@lufonzi
Copy link

lufonzi commented Aug 19, 2023

Hi @GanGral, changing the version of tokenizers to 0.13.3 did work.

_done
#
# To activate this environment, use
#
#     $ conda activate ai4beg
#
# To deactivate an active environment, use
#
#     $ conda deactivate_

For newbies and non developers as I am I would add some notes:

  1. To find and modify a text file you do not need to do it from the miniconda console; I could find the requirements.txt file and modify it from the Windows 11 user interface, leveraging Notepad.
  2. After having modified the requirements.txt file, following the instructions here I have tried to run the command "conda env create --name ai4beg --file .devcontainer/environment.yml" but it produced an error. I could figure out that to solve the error I had to delete or rename a directory named ai4beg that is located here C:\Users\AppData\Local\miniconda3\envs. Basically the first run of the command had failed but, none the less, had created an environment that needs to be deleted for the process to rebuild it correctly

@kru2710shna
Copy link

Steps:
1 - Check Python Installation with python3 --version
2 - To create the virtual environment - python3 -m venv name_of_venv
3 - To Activate the environment - source name_of_venv/bin/activate
4 -

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants