Error using pyversion, Too many input arguments.

4 ビュー (過去 30 日間)
Mukesh
Mukesh 2024 年 2 月 29 日
移動済み: Fangjun Jiang 2024 年 3 月 1 日
I want to create CoolProp in my MATLAB interface. for this, I installed Python 3.11 for window 11. After that i opened MATLAB 2023a and I typed in my MATLAB Command window: pyversion C:\Users\ASUS\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Python 3.11\python.exe
I am getting: Error using pyversion, Too many input arguments.
can anyone help me for executing the above?
thank yoy in advace for your valuable suggesion.

回答 (2 件)

Fangjun Jiang
Fangjun Jiang 2024 年 2 月 29 日
編集済み: Fangjun Jiang 2024 年 2 月 29 日
Might be the white space in the folder name? Try
pyversion("C:\Users\ASUS\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Python 3.11\python.exe")
pyversion('C:\Users\ASUS\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Python 3.11\python.exe')
By the way, it is recommended to use pyenv
  2 件のコメント
Mukesh
Mukesh 2024 年 3 月 1 日
Hi Fangjun Jiang,
Thank you for your comment!
By using
pyversion("C:\Users\ASUS\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Python 3.11\python.exe")
it gives an error like:
Error using pyversion
Path argument does not specify a valid executable.
And after that when when we are using pyenv instead of pyversion, it also gives error
pyenv('C:\Users\ASUS\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Python 3.11\python.exe')
Error using pyenv
Invalid number of arguments.
Fangjun Jiang
Fangjun Jiang 2024 年 3 月 1 日
移動済み: Fangjun Jiang 2024 年 3 月 1 日
If you look at the file under C:\Users\ASUS\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Python 3.11\, they are most likely "short cut" file, not executable. Please locate the actual .exe file.

サインインしてコメントする。


Mike Croucher
Mike Croucher 2024 年 2 月 29 日
編集済み: Mike Croucher 2024 年 2 月 29 日
Hi Mukesh
Try this
pyenv(Version="C:\Users\ASUS\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Python 3.11\python.exe")
  1 件のコメント
Mukesh
Mukesh 2024 年 3 月 1 日
Hi Mike Croucher'
Thank you for your comment! I appreciate your insight and perspective.
But I tried as your comments such as: pyenv(Version="C:\Users\ASUS\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Python 3.11\python.exe")
it gives an error like:
Error using pyenv
Path argument does not specify a valid executable.
Could you please provide any additional insights or suggestions on resolving this issue?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeCall Python from MATLAB についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by