https://github.com/yingding/python-every-day
this repository contains python3 code snippets for repetitive problems and understanding new concepts
https://github.com/yingding/python-every-day
Last synced: 12 months ago
JSON representation
this repository contains python3 code snippets for repetitive problems and understanding new concepts
- Host: GitHub
- URL: https://github.com/yingding/python-every-day
- Owner: yingding
- Created: 2022-10-07T09:38:39.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-06-11T14:13:45.000Z (about 2 years ago)
- Last Synced: 2025-01-05T19:42:29.163Z (over 1 year ago)
- Language: Jupyter Notebook
- Size: 23.8 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# python-every-day
this repository contains python3 code snippets for repetitive problems and understanding new concepts
# python venv installation
## MacOSX
### Find the python path
```
brew search python
brew install python@3.10
brew info python@3.10
```
console outputs:
```console
/opt/homebrew/opt/python@3.10/bin/python3
```
### Create VENV with specifiy python version
```
/opt/homebrew/opt/python@3.10/bin/python3 -m venv ~/VENV/metal3.10
```
### select the interpreter in VS code
select the interpreter -> enter interpreter path -> `~/VENV/metal3.10/bin/python3.10`
### install packages
In VS code terminal after the VENV is activate:
```shell
python3 -m pip uninstall -y tensorflow tenstensorflow-macos tensorflow-metal tensorflow-federated
python3 -m pip install -r requirements.txt
```
(optional) from a terminal
```shell
# /bin/activate
source ~/VENV/metal3.10/bin/activate
pip install --upgrade pip
pip install -r /requirements.txt
deactivate
```
### Add a jupyter notebook kernel to VENV
```shell
source ~/VENV/metal3.10/bin/activate
pip install ipykernel
ipython kernel install --user --name=metal3.10
```
Then you need to restart the vs code, to select the venv as jupyter notebook kernel,
projectname/name is `metal3.10`, which is the venv name.
Reference:
* https://anbasile.github.io/posts/2017-06-25-jupyter-venv/