installing openpyxl - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: installing openpyxl (/thread-24030.html) |
installing openpyxl - delahug - Jan-28-2020 Hi, Total python newbie here; nearly 20 years since I've done any programming... I've managed to install python on my pc and run 'Hello, World!'... so far so good... but now I need to install the openpyxl library and am encountering problems... where should this be within the python folder/subfolders once installed? thanks RE: installing openpyxl - gruntfutuk - Jan-28-2020 You have a choice of any package being installed in the default directory, or creating a Python virtual environment using the venv command. The latter option is generally preferred to avoid polluting your base environment with packages that are specific to particular projects (and different projects are likely to need different packages, some of which might conflict with each other).So on Windows, we usually start Python using the py command on the command or powershell line, and you'd invoke a command like venv or pip using the -m option.Packages will typically install in <virtualenv_name>/lib/<python_ver>/site-packages when you have a virtual environment.You can check where pip has installed packages to using: pip list -v or py -m pip list -v
RE: installing openpyxl - snippsat - Jan-28-2020 Take a look at Python 3.6/3.7 and pip installation under Windows Just the same for 3.8 if you use that,so all in done bye pip .# Install C:\>pip install openpyxl Collecting openpyxl ..... Successfully built openpyxl Installing collected packages: openpyxl Successfully installed openpyxl-3.0.3 WARNING: You are using pip version 19.3.1; however, version 20.0.2 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' command. # Upgrade pip C:\>python -m pip install --upgrade pip Collecting pip ..... Successfully uninstalled pip-19.3.1 Successfully installed pip-20.0.2 # Test pip,see that's it's 20.0.2 C:\>pip -V pip 20.0.2 from c:\python37\lib\site-packages\pip (python 3.7) # Test that openpyxl work C:\>python Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 21:26:53) [MSC v.1916 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import openpyxl >>> >>> openpyxl.__version__ '3.0.3' >>> exit() C:\>Quick demo virtual environment as mention bye @gruntfutuk. # Make environment E:\div_code λ python -m venv my_env # Cd in E:\div_code λ cd my_env\ # Activate E:\div_code\my_env λ E:\div_code\my_env\Scripts\activate # Install (my_env) E:\div_code\my_env λ pip install openpyxl Collecting openpyxl ..... Successfully installed et-xmlfile-1.0.1 jdcal-1.4.1 openpyxl-3.0.3 # Show (my_env) E:\div_code\my_env λ pip show openpyxl Name: openpyxl Version: 3.0.3 Summary: A Python library to read/write Excel 2010 xlsx/xlsm files Home-page: https://openpyxl.readthedocs.io Author: See AUTHORS Author-email: [email protected] License: MIT Location: e:\div_code\my_env\lib\site-packages Requires: jdcal, et-xmlfile Required-by:It's now a isolated environment,like a new Python version not touching your main installation. |