You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
💫 chasten: Analyze the AST of Python Source Code
🔗 GitHub: https://github.com/gkapfham/chasten
✨ Starting a local datasette instance:
• Database: '...
subject-data\chasten-flattened-csvs-sqlite-db-all-programs-20230905151458-42dbbaac257447cfa602106ce0d5a93d\chasten.db'
• Metadata: 'None'
• Port: 8001
✨ Details for datasette startup:
• Venv: 'C:\Users\Preston\AppData\Local\pypoetry\Cache\virtualenvs\chasten-Ti8Qy4ta-py3.11'
• Cannot find: 'C:\Users\Preston\AppData\Local\pypoetry\Cache\virtualenvs\chasten-Ti8Qy4ta-py3.11/bin/datasette'
🤷 Was not able to find '{executable_name}'
I got this error when running the above command and found that its searching for the executable in a bin file when they are stored in a file called Scripts on Windows. I fixed this by changing the following code.
executable_name=constants.datasette.Datasette_Executable# define the name of the file that contains datasette metadata;# note that by default the metadata could be None and thus it# will not be passed as a -m argument to the datasette programmetadata=datasette_metadata# identify the location at which the virtual environment exists;# note that this is the location where executable dependencies of# chasten will exist in a bin directory. For instance, the "datasette"# executable that is a dependency of chasten can be found by starting# the search from this location for the virtual environment.virtual_env_location=sys.prefixfull_executable_name=virtual_env_location+"/bin/"+executable_name
(found_executable, executable_path) =filesystem.can_find_executable(
full_executable_name
)
# output diagnostic
To
executable_name=constants.datasette.Datasette_Executable+".exe"# define the name of the file that contains datasette metadata;# note that by default the metadata could be None and thus it# will not be passed as a -m argument to the datasette programmetadata=datasette_metadata# identify the location at which the virtual environment exists;# note that this is the location where executable dependencies of# chasten will exist in a bin directory. For instance, the "datasette"# executable that is a dependency of chasten can be found by starting# the search from this location for the virtual environment.virtual_env_location=sys.prefixscript=" \Scripts\ "scriptst=script.strip()
full_executable_name=virtual_env_location+scriptst+executable_name
(found_executable, executable_path) =filesystem.can_find_executable(
full_executable_name
)
and it ran on windows
💫 chasten: Analyze the AST of Python Source Code
🔗 GitHub: https://github.com/gkapfham/chasten
✨ Starting a local datasette instance:
• Database: '...
subject-data\chasten-flattened-csvs-sqlite-db-all-programs-20230913151430-90f2041a3273407e963e8b13cb404f5a\chasten.db'
• Metadata: 'None'
• Port: 8001
✨ Details for datasette startup:
• Venv: 'C:\Users\Preston\AppData\Local\pypoetry\Cache\virtualenvs\chasten-Ti8Qy4ta-py3.11'
• Program: 'C:\Users\Preston\AppData\Local\pypoetry\Cache\virtualenvs\chasten-Ti8Qy4ta-py3.11\Scripts\datasette.exe'
INFO: Started server process [31096]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://127.0.0.1:8001 (Press CTRL+C to quit)
This is a solution for Windows however it may mean we may need to run different code depending what OS people are using
since executables are stored differently on different OS
The text was updated successfully, but these errors were encountered:
We should rely on Path objects to concatenate paths. This automatically changes between different OSs. Windows uses \path\to\file while linux uses /path/to/file.
Pathlib: https://docs.python.org/3/library/pathlib.html
Hi, I agree with @simojo that this is the general-purpose solution. However, there is one additional challenge faced with this issue. This part of the program needs to run a different executable inside of a virtual environment depending on whether this program is being run on Windows or MacOS/Linux. I've gone through this issue in detail with @Poiuy7312. Can you summarize what we discussed @Poiuy7312 and then say how you are going to push this forward? Thanks everyone for your contributions to this issue and to its ultimate resolution.
chasten datasette-serve C:\Users\Preston\CMPSC-203\ChastenProject\chasten\subject-data\chasten-flattened-csvs-sqlite-db-all-programs-20230905151458-42dbbaac257447cfa602106ce0d5a93d\chasten.db --port 8001
I got this error when running the above command and found that its searching for the executable in a bin file when they are stored in a file called Scripts on Windows. I fixed this by changing the following code.
To
and it ran on windows
This is a solution for Windows however it may mean we may need to run different code depending what OS people are using
since executables are stored differently on different OS
The text was updated successfully, but these errors were encountered: