I’m window user. I want to executes this code
(code: Mechanica Documentation Release 0.0.14)
import mechanica as m
import numpy as np
# potential cutoff distance
cutoff = 1
# dimensions of universe
dim=[10., 10., 10.]
# new simulator, don't load any example
m.Simulator(example="", dim=dim)
# create a potential representing a 12-6 Lennard-Jones potential
(continues on next page)
10 Chapter 3. Quickstart
Mechanica Documentation, Release 0.0.14
(continued from previous page)
# A The first parameter of the Lennard-Jones potential.
# B The second parameter of the Lennard-Jones potential.
# cutoff
pot = m.Potential.lennard_jones_12_6(0.275 , cutoff, 9.5075e-06 , 6.1545e-03 , 1.0e-3
˓→)
# create a particle type
# all new Particle derived types are automatically
# registered with the universe
class Argon(m.Particle):
mass = 39.4
# bind the potential with the *TYPES* of the particles
m.Universe.bind(pot, Argon, Argon)
# uniform random cube
positions = np.random.uniform(low=0, high=10, size=(10000, 3))
for pos in positions:
# calling the particle constructor implicitly adds
# the particle to the universe
Argon(pos)
# run the simulator interactive
m.Simulator.run()
but i don’t know how can install mechanica. In cmd line command, I write this:
C:UsersUsuario>pip install mechanica and appears Defaulting to user installation because normal site-packages is not writeable ERROR: Could not find a version that satisfies the requirement mechanica (from versions: none) ERROR: No matching distribution found for mechanica
How can I install mechanica?
Additional information: I have python and pip installed.
C:UsersUsuario>python3 --version Python 3.12.4
C:UsersUsuario>python3 -m pip --version pip 24.0 from C:Program FilesWindowsAppsPythonSoftwareFoundation.Python.3.12_3.12.1264.0_x64__qbz5n2kfra8p0Libsite-packagespip (python 3.12)
C:UsersUsuario>python3 -m pip install --upgrade pip setuptools wheel
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: pip in c:program fileswindowsappspythonsoftwarefoundation.python.3.12_3.12.1264.0_x64__qbz5n2kfra8p0libsite-packages (24.0)
Collecting pip
Downloading pip-24.1-py3-none-any.whl.metadata (3.6 kB)
Requirement already satisfied: setuptools in c:usersusuarioappdatalocalpackagespythonsoftwarefoundation.python.3.12_qbz5n2kfra8p0localcachelocal-packagespython312site-packages (70.1.0)
Requirement already satisfied: wheel in c:usersusuarioappdatalocalpackagespythonsoftwarefoundation.python.3.12_qbz5n2kfra8p0localcachelocal-packagespython312site-packages (0.43.0)
Downloading pip-24.1-py3-none-any.whl (1.8 MB)
---------------------------------------- 1.8/1.8 MB 3.6 MB/s eta 0:00:00
Installing collected packages: pip
WARNING: The scripts pip.exe, pip3.12.exe and pip3.exe are installed in 'C:UsersUsuarioAppDataLocalPackagesPythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0LocalCachelocal-packagesPython312Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pip-24.1
I want execute this code and view the simulation