Supportvragen Mac > Programmeren in bijvoorbeeld C(++), Cocoa, Java, BASIC, en Swift

Python in macOS 13?

<< < (2/3) > >>

GeorgeM:
Ik werk nooit met Python, maar is de oplossing voor jouw probleem niet hier te vinden?

https://docs.python.org/3/using/mac.html

Bijvoorbeeld dit:


--- Citaat ---To run your script from the Finder you have two options:


* Drag it to PythonLauncher
* Select PythonLauncher as the default application to open your script (or any .py script) through the finder Info window and double-click it. PythonLauncher has various preferences to control how your script is launched. Option-dragging allows you to change these for one invocation, or use its Preferences menu to change things globally.
--- Einde van citaat ---

Jakko W:
Dat zouden oplossingen zijn, ware het niet dat ik gewoon de scripts wil draaien zoals altijd: in de terminal. Ik heb altijd een terminalvenster openstaan dat ik regelmatig gebruik voor allerlei van dit soort dingen die makkelijker in de terminal gaan dan in de Finder. Om scripts naar applicaties te moeten slepen, of erop gaan dubbelklikken, is voor mij een onhandige manier van werken t.o.v. even een deel van de naam intikken en op Tab drukken.

Maar als ik op de genoemde pagina kijk, lees ik:

--- Citaat ---The Apple-provided build of Python is installed in /System/Library/Frameworks/Python.framework and /usr/bin/python, respectively.
--- Einde van citaat ---
… en dat is niet waar op mijn computer. Dat /usr/bin/python niet bestaat had ik al ontdekt, maar /System/Library/Frameworks/Python.framework blijkt ook opvallend afwezig te zijn …

Er is dus duidelijk iets mis op mijn computer, maar waarom? En belangrijker: hoe los ik het op?

En voor de zekerheid heb ik dit net nog even gecontroleerd op een andere Mac hier in huis die ook recent voorzien is van macOS 13 (maar waar nooit zelfgeschreven scripts op gedraaid worden), en ook daar zijn /usr/bin/python en /System/Library/Frameworks/Python.framework niet aanwezig.

Laat ik maar eens beginnen met Xcode vanuit de App Store te installeren. Wellicht dat dat iets oplost.

puk1980:
https://discussions.apple.com/thread/254320722


--- Citaat ---python3  is not included in Ventura, but it can be added by installing the command-line tools with:


--- Code: ---xcode-select --install
--- Einde van code ---

(https://osxdaily.com/2014/02/12/install-command-line-tools-mac-os-x/), and after installation, it has the benefit of being updated with macOS updates

--- Einde van citaat ---

En https://freegistutorial.com/install-python-3-on-macos-ventura/

Jakko W:

--- Citaat van: puk1980,  5 november 2022 - 11:07 ---https://discussions.apple.com/thread/254320722

--- Einde van citaat ---
Inderdaad, dat doet het, maar zoals ik al uitlegde: al je scripts die python aanroepen in plaats van python3 (en dat is, gok ik, het overgrote deel) werken dan nog steeds niet … Een oplossing daarvoor heb ik nog altijd niet gevonden.

puk1980:

--- Citaat van: Jakko W,  5 november 2022 - 19:21 ---... al je scripts die python aanroepen in plaats van python3 werken dan nog steeds niet … Een oplossing daarvoor heb ik nog altijd niet gevonden.

--- Einde van citaat ---

https://osxdaily.com/2022/02/15/make-python-3-default-macos/


--- Citaat ---Add the following alias at the bottom of the .zshrc file:


--- Code: ---alias python=/usr/local/bin/python3

--- Einde van code ---

--- Einde van citaat ---

Navigatie

[0] Berichtenindex

[#] Volgende pagina

[*] Vorige pagina

Naar de volledige versie