There are some Python codes which can only be run in Command Prompt, and can only be run in Sublimes? I am a new user of Python. But I am very familiar with R and Stata. In R, I can install some package and use the library at the same place. But in python, it seems I can only run pip install in command prompt, and I can only use import numpy as np in Sublimes (or some other platform).
I need some explanation to help me understand. Many thanks in advance!
Most common to use pip from command line,also install packages from
PyPi.
If use eg
JupyterLab Notebooks then can install with pip and run code in one place.
Example
NoteBook.
In your previous
Thread they just use the code directly from Repo.
They could have make package,but have not done that as many of these ML is more of one time test or proof of concept.
There is
setup.py so if i do quick build.
(suspender_env) G:\div_code\suspender_env\notears (master)
λ pip install -q build
(suspender_env) G:\div_code\suspender_env\notears (master)
λ python -m build
* Creating venv isolated environment...
* Installing packages in isolated environment... (setuptools >= 40.8.0, wheel)
* Getting build dependencies for sdist...
# Now have a wheel that install
(suspender_env) G:\div_code\suspender_env\notears\dist (master)
λ pip install notears-3.0-py3-none-any.whl
.....
Now will the import works,not document because they did not do this step.
(suspender_env) G:\div_code\suspender_env\notears\dist (master)
λ ptpython
>>> from notears import utils
>>>
>>> utils.simulate_linear_sem
<function simulate_linear_sem at 0x000001E2FF460FE0>
>>> exit()
Look at
Shiny there can easily compare Python and R code.