pipopenpyxlsetuptools

Struggling to install on python


I recently started delving into python (been postponing due to the learning curve!) and am facing some struggles right off the bat. I want to start out working with spreadsheets alongside a tutorial, but cannot get the necessary tools to install and work.

I've installed Python 3.12, followed by the latest Visual Studio Code, where I am mainly operating in, and then tried to install openpyxl to work on excel spreadsheets. I've got some code typed in a python project, but require openpyxl to compile and execute the code. Upon trying to install openpyxl, I received an error "no such file or directory". It appeared through troubleshooting that I require "setuptools" to be installed first, so off I went. Trying to install setup tools following the guide at https://setuptools.pypa.io/en/latest/userguide/quickstart.html didn't help much, as I ran into trouble figuring out how to operate the pip installations. So off I go trying to figure out what/where/how pip works, but ran into trouble trying the suggestions at this page https://www.w3schools.com/python/python_pip.asp. I've opened CMD and tried to execute the suggest install commands for setuptools, but I receive the error "the system cannot find the path specified. I don't know what is missing or what I'm doing wrong to get the errors below: my attempted filepath in cmd and I'm trying to point it to this directory, assuming it is correct: my filepath in python scripts folder

At this point I'm quite frustrated by the whole process of each library/script requiring another library/script requiring another, and the root not working, causing everything else to not work. I would please appreciate handholding/signposting in getting this resolved!


Solution

  • this is my solution. You can refer to it, if you have any difficulty, please comment and I will help.

    Firstly, I don't know exactly your os system, so base on you os, you can install pip in your laptop or pc.

    For me, I use conda for managing my python environment, this's optional, so if you want to install it, you can access and install following the instructions.

    For setuptools, I haven'y installed this library yet, but my code still run good, so I think you don't neet install setuptools to run openpyxl.

    In Visual Code, in the extensions, you can install python directly. (https://www.youtube.com/watch?v=KkVLNvFh0-M)

    For the first install python environment, I usually do the initial step like this (https://www.liquidweb.com/help-docs/adding-python-path-to-windows-10-or-11-path-environment-variable/), you can access and follow the instructions.

    After the above things, you can check pip version:

    pip --version and run pip install openpyxl

    Hope the aboves helps you good.