self-operating-computer icon indicating copy to clipboard operation
self-operating-computer copied to clipboard

requirements.txt File: dependencies required for the project.

Open sprinteroz opened this issue 10 months ago • 1 comments

requirements.txt File: dependencies required for the project. must be run on: python 3.12 C:\Users\user\self-operating-computer\requirements.txt numpy==1.26.2 Might need to Include other libraries if needed


`C:\Users\user>pip install numpy==1.26.1 Defaulting to user installation because normal site-packages is not writeable ERROR: Could not find a version that satisfies the requirement numpy==1.26.1 (from versions: 1.3.0, 1.4.1, 1.5.0, 1.5.1, 1.6.0, 1.6.1, 1.6.2, 1.7.0, 1.7.1, 1.7.2, 1.8.0, 1.8.1, 1.8.2, 1.9.0, 1.9.1, 1.9.2, 1.9.3, 1.10.0.post2, 1.10.1, 1.10.2, 1.10.4, 1.11.0, 1.11.1, 1.11.2, 1.11.3, 1.12.0, 1.12.1, 1.13.0, 1.13.1, 1.13.3, 1.14.0, 1.14.1, 1.14.2, 1.14.3, 1.14.4, 1.14.5, 1.14.6, 1.15.0, 1.15.1, 1.15.2, 1.15.3, 1.15.4, 1.16.0, 1.16.1, 1.16.2, 1.16.3, 1.16.4, 1.16.5, 1.16.6, 1.17.0, 1.17.1, 1.17.2, 1.17.3, 1.17.4, 1.17.5, 1.18.0, 1.18.1, 1.18.2, 1.18.3, 1.18.4, 1.18.5, 1.19.0, 1.19.1, 1.19.2, 1.19.3, 1.19.4, 1.19.5, 1.20.0, 1.20.1, 1.20.2, 1.20.3, 1.21.0, 1.21.1, 1.22.0, 1.22.1, 1.22.2, 1.22.3, 1.22.4, 1.23.0, 1.23.1, 1.23.2, 1.23.3, 1.23.4, 1.23.5, 1.24.0, 1.24.1, 1.24.2, 1.24.3, 1.24.4, 1.25.0, 1.25.1, 1.25.2, 1.26.2, 1.26.3, 1.26.4, 2.0.0, 2.0.1, 2.0.2, 2.1.0rc1, 2.1.0, 2.1.1, 2.1.2, 2.1.3, 2.2.0rc1, 2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.2.4) ERROR: No matching distribution found for numpy==1.26.1

C:\Users\user>pip install numpy==1.26.2

Defaulting to user installation because normal site-packages is not writeable Collecting numpy==1.26.2 Downloading numpy-1.26.2.tar.gz (15.7 MB) ---------------------------------------- 15.7/15.7 MB 2.0 MB/s eta 0:00:00 Installing build dependencies ... done Getting requirements to build wheel ... done Installing backend dependencies ... done Preparing metadata (pyproject.toml) ... done Building wheels for collected packages: numpy Building wheel for numpy (pyproject.toml) ... done Created wheel for numpy: filename=numpy-1.26.2-cp313-cp313-win_amd64.whl size=20691844 sha256=25adab590be9b12ebdd75af2cb09faf55d83b899e5a1900e7ee402a30e2f6f18 Stored in directory: c:\users\user\appdata\local\pip\cache\wheels\c9\15\32\8370c1b87f23602d92aa9dd11d143dee8df8b5fc2fdbf2b40b Successfully built numpy Installing collected packages: numpy Successfully installed numpy-1.26.2 `**********************

You also need Pip installed, add pip PATH into environment variables

Add the Scripts Directory to PATH Locate Your Python Scripts Directory: C:\Users\user\AppData\Roaming\Python\Python313\Scripts This is where pip.exe and other Python script executables are located.

Add the Directory to PATH:

Open the Start Menu, search for Environment Variables, and select Edit the system environment variables.

In the System Properties window, click Environment Variables.

Under User variables, find the PATH variable and click Edit.

Click New and paste the path: C:\Users\user\AppData\Roaming\Python\Python312\Scripts Click OK to save changes.

Verify the PATH Update:

  • Restart your Command Prompt or PowerShell for the changes to take effect.

Test by running: pip --version It should now work without warnings.

Alternative Temporary Fix If you prefer not to modify your PATH, you can explicitly call pip using its full path: C:\Users\user\AppData\Roaming\Python\Python312\Scripts\pip install

sprinteroz avatar Mar 23 '25 07:03 sprinteroz

I will try this work around as i think the PowerShell is defaulting to 3.13 and i need to install it in 3.12.

To use both Python 3.12 and 3.13, you can utilize virtual environments, which isolate project dependencies and allow you to switch between different Python versions for different projects. Here's a breakdown of how to achieve this:

  1. Create Virtual Environments:For Python 3.12:Open a terminal or command prompt. Navigate to your project directory. Run python3.12 -m venv <env_name> (replace <env_name> with your desired environment name, e.g., py312_env). For Python 3.13: Open a terminal or command prompt. Navigate to your project directory. Run python3.13 -m venv <env_name> (replace <env_name> with your desired environment name, e.g., py313_env).
  2. Activate the Virtual Environment:For Python 3.12:Open a terminal or command prompt.Navigate to your project directory. Run source <env_name>/bin/activate (replace <env_name> with the name of your Python 3.12 environment, e.g., py312_env/bin/activate). For Python 3.13: Open a terminal or command prompt. Navigate to your project directory. Run source <env_name>/bin/activate (replace <env_name> with the name of your Python 3.13 environment, e.g., py313_env/bin/activate).
  3. Install Packages: Once the virtual environment is activated, you can install packages using pip (e.g., pip install <package_name>). These packages will be installed within the specific virtual environment, and won't interfere with other Python versions or projects.
  4. Deactivate the Virtual Environment: When you're finished working with a project, deactivate the environment by running deactivate in the terminal. Example: Let's say you have two projects: project_a (using Python 3.12) and project_b (using Python 3.13). For project_a (Python 3.12): Create a virtual environment: python3.12 -m venv py312_env Activate it: source py312_env/bin/activate Install packages: pip install requests Deactivate when finished: deactivate For project_b (Python 3.13): Create a virtual environment: python3.13 -m venv py313_env Activate it: source py313_env/bin/activate Install packages: pip install pandas Deactivate when finished: deactivate Key Takeaways: Virtual environments are essential for managing multiple Python versions and project dependencies. Each virtual environment is isolated, preventing conflicts between different projects. You can easily switch between virtual environments by activating and deactivating them.

sprinteroz avatar Mar 25 '25 15:03 sprinteroz