Message Boards Message Boards

GROUPS:

Problem with HighSchoolBiology library

Posted 1 month ago
348 Views
|
5 Replies
|
0 Total Likes
|

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.

5 Replies

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

Posted 1 month ago

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

"/Users/qunyongwang/test"

Thanks again.

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 1 month ago

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

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]
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