Message Boards Message Boards

0
|
6023 Views
|
5 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Problem with HighSchoolBiology library

Posted 4 years ago

Hi, I am a new user of HighSchoolBiology library. I want to use it to simulate the pandemic dynamics. But when i download the HighSchoolBiology.nb and open it, and click the "Try the lab", it warns the following information

"DirectoryName::string: String expected at position 1 in DirectoryName[$Failed[[1]][SourceFile]]." 

Any advice is appreciated. Thank you.

POSTED BY: Qunyong Wang
5 Replies

Hi Qunyong,

Can you try the following steps and let me know at which step you are facing an issue?

Step 1: Download library files

library = 
  Import[URLDownload[
     "http://dl.wolframcdn.com/0036F4/pub/WSMVirtualLabs/\
HighSchoolBiology/1.1.0.0/HighSchoolBiology_1.1.0.sma"], "SMA"][[1]];

Step 2: Get the library path

libraryPath = library["SourceFile"];

Step 3: Function to open a library nb

lab[x_] := 
 NotebookOpen[
  FileNameJoin[{DirectoryName[libraryPath], "Resources", 
    "LabNotebooks", 
    ToString[{"PlasmaMembrane", "FoodMetabolism", "Ibuprofen", 
        "NaturalSelection", "HerdImmunity"}[[x]]] <> ".nb"}]]

Step 4: Open the Herd Immunity lab

lab[5]
POSTED BY: Ankit Naik
Posted 4 years ago

Many thanks again. I updated my computer. But it doesn't work. I don't know what is wrong with it.

POSTED BY: Qunyong Wang

Assuming you are working on Mac? Your path looks fine. I just download the latest version and it works out of box on OS X Catalina 10.15.4.

POSTED BY: Shenghui Yang
Posted 4 years ago

Thank you. How to see if the path contains non-ascii character? My path is

"/Users/qunyongwang/test"

Thanks again.

POSTED BY: Qunyong Wang

You may try to save the notebook to a path free of non-ascii character.

POSTED BY: Shenghui Yang
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract