Reputation: 121
I am writing a project in NativeScript and I received the following error the last few days when I tried the commands: ns run ios
or ns doctor
.
Couldn't retrieve installed python packages.
The Python 'six' package not found.
I tried python and pip upgrade and also the command pip install six
.
Nothing of them fixed the problem.
I believe that is not a NativeScript issue, is about the configuration of the python packages in my machine. I mention that I am using a MacBook with M1 chip and it is running the 12.5 OS version.
I will appreciate any suggestions on this situation.
Upvotes: 1
Views: 2387
Reputation: 26
After some searching, the solution that worked for me was to install pyenv
, a Python version manager. You can find the repository here: pyenv.
In my .zshrc
file, I had Python 3 configured with the following path: /Library/Frameworks/Python.framework/Versions/3.12/bin/python3. (Your path might differ or you might not have this path, which is okay.)
I commented out that line and set up pyenv
instead. You can configure and install pyenv. After that, I switched to the required Python version using pyenv
. Once I had the correct version set up, everything worked as expected.
Upvotes: 0
Reputation: 306
Try doing it with the python virtual environment. Following are the steps.
Implement as follows:
python3 -m venv venv
source venv/bin/activate
venv\Scripts\activate.bat
'venv\Scripts\Activate.ps1'
python3 -m pip install --upgrade pip
python3 -m pip install six
Note: This works only when you are in the virtual environment.
Upvotes: 0
Reputation: 121
Lastly, I found the solution. It was about the python folder into the path /usr/local/bin/python
You could check it by the following command: where python
In my case this folder is missing, perhaps I deleted it after the upgrade of the python3.
That was a mistake both folders should exist on this path!
If you type: where python
you should receive: /usr/local/bin/python
If you type: where python3
you should receive: /usr/local/bin/python3
In order to fix the error, I installed python again by using the brew install pyenv
this suggestion helps me to install it properly.
In the end, in order to eliminate all errors I installed the Python six package by using the command:
pip install --ignore-installed six
Upvotes: 2