PyEnv Basics Tutorial with Cheatsheet | Manage Multiple Python Versions | by OsChannel.com

preview_player
Показать описание

How to install and get started with PyEnv on Windows/Mac/Linux system:
This youtube video shows, ways to install Pyenv and then install/uninstall different versions of Python on the same windows/mac/Linux machine. Once that is done you can use some basic to advanced PyEnv commands from this tutorial to manage python versions at the global, projects or shell level.

The Tutorial Covers Below Topics:
00:00 - Introduction to PyEnv
00:34 - PyEnv Installation and Setup
01:34 - Installing Different Python Versions
03:27 - Set Python Version for all Projects
03:59 - Set Python Version at Project Level
05:14 - Set Python Version at Shell Level
06:14 - Unset a Python Version set by PyEnv
06:38 - PyEnv Precedence
06:56 - Cheatsheet and Outro

Apart from the above topics it also covers an error that I faced on my macOS Big Sur while installing any Python version lower than 3.8(including 3.8)

Error text:
./Modules/posixmodule.c:8431:15: error: implicit declaration of function 'sendfile' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
ret = sendfile(in, out, offset, &sbytes, &sf, flags);

1 error generated.
make: *** [Modules/posixmodule.o] Error 1
make: *** Waiting for unfinished jobs....
1 warning generated.

FIX for above pyenv sendfile error:

I thank all the contributors for the awesome PyEnv Tool ..!!

Subscribe to OsChannel for more such tricks -
CHANNEL LINK:

LINK TO MY WEBSITE:
Рекомендации по теме
Комментарии
Автор

*Fix for the sendfile error* - "error: implicit declaration of function 'sendfile' is invalid in C99":


*Cheatsheet:*

OschannelDotCom
Автор

Any tips for window users?

For example, I sometimes have to run a windows setup exe or a whl to install a specific python package.. (ex PyQt 5.4 can't be installed via pip), how would this work with pyenv/virtualenv?

I'm actually only interested in building EXEs from 2 python versions.. Python 3.4.4 (32-bit for WinXP) and Python 3.11.1 (64-bit). Would it be easier in my case to just change the PATH whenever I want to switch between? What would pyenv/venv add?

What happens if you already have multiple python versions already installed, before you've installed pyenv?

bennguyen
Автор

I am new to programming and Python and struggling to set up pyenv with the correct path on my MacBook Pro Big Sur. Can you help? Could I send you what my terminal looks like? Thank you.

keithseebeck
visit shbcf.ru