2

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?

5
  • 1
    Hi~@Gap Chen Do you install it in the clear python environment? Is your environment installed another package before maybe for some reason to develop?
    – Milo Chen
    Commented Apr 3, 2023 at 16:27
  • 2
    This is a used Mac my friend gave me. So I don't know.
    – Gap Chen
    Commented Apr 3, 2023 at 16:29
  • 1
    Great ~ Maybe you can consider setting up your pynecone development environment using some virtual environment. I did it, and it works for me.
    – Milo Chen
    Commented Apr 3, 2023 at 16:32
  • 1
    I am not very familiar with the python virtual environment. Could you give me a favor?
    – Gap Chen
    Commented Apr 3, 2023 at 16:35
  • 1
    Of course. In the official document, We need (1) The python with pynecone package and (2) NodeJS 12.22. I use conda to setup python virtual environment (python 3.11). And I use n to setup NodeJS 12.22. Please wait for me a moment. I will prepare the article to reply to your question.
    – Milo Chen
    Commented Apr 3, 2023 at 16:40

3 Answers 3

2

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
2

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

1

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.