The command pc not found after installing pynecone environment on my Mac computer

270 Views Asked by At

I read it https://pynecone.app/docs/getting-started/installation.

Installing

$ pip install pynecone
$ mkdir my_app_name
$ cd my_app_name
$ pc init
zsh: command not found: PC

Why the command pc not found?

After installing, I tried to create a project but failed because no pc command.

In my case, I use a second-hand Mac.
And maybe the current Python environment are mass.
So, I have no idea what to do next. Can anyone help me?

3

There are 3 best solutions below

0
Milo Chen On BEST ANSWER

Install NodeJS 12.22

  1. Install n
$ curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
$ sudo npm install -g n
  1. Install NodeJS 12.22 by n
$ sudo n 12.22

Setup pynecone environment

  1. Install anaconda from https://www.anaconda.com/products/distribution
  2. Make pynecone virtual environment by conda command
  • Create clear python 3.11 virtual environment
$ conda create -n pynecone-311 python=3.11
  • Go into the python 3.11 virtual environment
$ conda activate pynecone-311
  • Install pynecone package
$ pip install pynecone
  • Test pynecone environment
$ mkdir my_app_name
$ cd my_app_name
$ pc init
$ pc run 

Then you can enjoy it.

If you need more information to use conda and n.

You can refer to my document here.
https://hackmd.io/@milochen0418/create-pynecone-env-in-mac
It details how to use them to
manage the virtual environment.

0
Mark Setchell On

You'll need to:

  • find where the pc binary (program) is installed, and
  • ensure it's on your PATH.

To find it, run:

find /usr /opt ~ -type f -name pc

That will look in /usr, /opt and your HOME directory for a file (not directory) called pc.


When you find it, you can either use the full path every time you run pc, or add the directory that contains pc to your PATH. So, if you find it in:

/usr/local/bin/pc

you will either need to use:

/usr/local/bin/pc ...

every time you want to run it, or just do this once:

export PATH=$PATH:/usr/local/bin

then you can run it each time with just:

pc ...

because it will be on your PATH.

0
Milo Chen On

One command to install everything for beginner of programmer

There is another way if you don't want to install NodeJS manually. Because there is some package can support nodejs in default.

(1) Install anaconda from https://www.anaconda.com/products/distribution Open terminal

(2) One command to setup pynecone application development environment in conda

eval "conda create -n pynecone-core python=3.11 -y && conda install -n pynecone-core -c conda-forge pynecone -y"

If you are VSCode user , VSCode's terminal has issue to set wrong PATH for conda.

In the VSCode's terminal, we can use the following way to activate the environment.

eval "conda deactivate && conda deactivate && conda activate pynecone-core"

Now, everything is ok now.

In the final, you can type the following command the check your terminal is run in the correct path and the correct version of Python and nodejs.

which node
node --version
which python 
python --version

The paths of node and python should be on the following.
$HOME/opt/anaconda3/envs/pynecone-core/bin/python
$HOME/opt/anaconda3/envs/pynecone-core/bin/node