Create bluesky directory#
Use the new_bluesky_instrument.py
program
to install a new bluesky instrument configuration from the online APS
Bluesky Training
repository template. The program creates a new bluesky
directory in
the home directory. Use new_bluesky_instrument.py -h
for usage
information.
The new_bluesky_instrument.py
program requires Python 3.6+ and the
requests
package.
How can I tell the python version I am using?
Type the following command:$ python --versionThis will print the version of Python currently installed on your system. You may wish to review instructions to upgrade Python.
How can I tell if the requests package is installed?
Test that therequests
package is available by trying to import
it. In a terminal, type the following command and press Enter:
$ python3 -c "import requests"If the command runs without any errors, then you have the
requests
package installed. If you don't have it installed,
you'll see an error message like:
"ModuleNotFoundError: No module named 'requests'"
Run the installer program (instructions are different if you are using a
workstation at APS with access to the /APSshare
file server):
On an APS machine with access to APSshare, run this command from a terminal session:
$ python3 /APSshare/bin/new_bluesky_instrument.py ~/bluesky
Tip
Needs outside network access at APS.
Remember, since this will try to download content from the public internet, it only works from workstations with access to networks outside of APS. From local private networks, it will stall in the first steps.
Workstations on other networks (with no access to APSshare) need to
download this program. Open the file in your browser with this
link
and use your browser’s commands to Save As … in the directory of
your choice (use the file name: new_bluesky_instrument.py). Then,
navigate to the directory where the program was downloaded and run the
following command:
$ python3 new_bluesky_instrument.py ~/bluesky
When run successfully, the program output should look like this:
INFO:__main__:Requested installation to: 'bluesky' INFO:__main__:Downloading 'https://github.com/BCDA-APS/bluesky_training/archive/refs/heads/main.zip' INFO:__main__:Extracting content from '/tmp/bluesky_training-main.zip' INFO:__main__:Installing to '/home/user/bluesky' INFO:__main__:Initialized Git repository in '/home/user/bluesky'
The installer program takes care of initializing a local git repository in the
bluesky
folder. Further instructions are provided below to create a remote reposititory.