Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run code in codespace #45

Closed
npr99 opened this issue Feb 28, 2024 · 20 comments
Closed

Run code in codespace #45

npr99 opened this issue Feb 28, 2024 · 20 comments

Comments

@npr99
Copy link
Owner

npr99 commented Feb 28, 2024

GitHub has a new option to run code in a virtual environment called codespace. This sounds like a good idea but - when I initially launch the codespace the environment is not setup. I had expected the environment to be based on the .yml file. But it looks like I need to make a .dev file.

Following these instructions:
https://docs.github.com/en/codespaces/setting-up-your-project-for-codespaces/adding-a-dev-container-configuration/setting-up-your-python-project-for-codespaces

@npr99
Copy link
Owner Author

npr99 commented Feb 28, 2024

image
I use 3.10.9 in the last environment but I do not know if that is bookworm, buster or bullseye. Looks like these have something to do with the docker image. I will try the default 3.12 bullseye

@npr99
Copy link
Owner Author

npr99 commented Feb 28, 2024

following instructions and selecting coverage.py.... not sure what this does
image

@npr99
Copy link
Owner Author

npr99 commented Feb 28, 2024

@npr99
Copy link
Owner Author

npr99 commented Feb 28, 2024

image
Tip: You may occasionally want to perform a full rebuild to clear your cache and rebuild your container with fresh images. For more information, see

@npr99
Copy link
Owner Author

npr99 commented Feb 28, 2024

image

looks like something is happening. I made a requirements files with the primary conda packages. I did not include the pip packages

pandas=1.3.5
geopandas=0.12.2
requests=2.27.1
seaborn=0.11.2
scooby=0.5.12
jupyter=1.0.0
contextily=1.3.0

@npr99
Copy link
Owner Author

npr99 commented Feb 28, 2024

the codespace still wanted me to start a new kernel.

@npr99
Copy link
Owner Author

npr99 commented Feb 28, 2024

updated the requirements files to include ipywidgets==7.7.1... that was the error I just got. Will see if rebuilding the codespace shows that the requirments file is doing something.

@npr99
Copy link
Owner Author

npr99 commented Feb 28, 2024

still have issue....using this example to see if that fixes some of the problems.
https://github.com/github/codespaces-jupyter/blob/main/.devcontainer/devcontainer.json

@npr99
Copy link
Owner Author

npr99 commented Feb 28, 2024

The example from codespaces-jupyter works from their repo.... I did not have to pick the kernel

@npr99
Copy link
Owner Author

npr99 commented Feb 28, 2024

test comment getting error message saying can not save comment

@npr99
Copy link
Owner Author

npr99 commented Feb 28, 2024

ipywidgets==7.7.1
matplotlib==3.7.0
numpy==1.24.2
pandas=1.3.5
geopandas=0.12.2
requests=2.27.1
seaborn=0.11.2
scooby=0.5.12
contextily=1.3.0

@npr99
Copy link
Owner Author

npr99 commented Feb 28, 2024

just noticed that requirements uses == not =

@npr99
Copy link
Owner Author

npr99 commented Feb 28, 2024

this time it seems to have selected python 3.10.13 - it took a second but it seems to have done that. But it still can not find the ipywidgets... it seems to have installed the requirements file automatically. I just had to run the first block of the main notebook and wait. The terminal showed that the installation was happening.
image

@npr99
Copy link
Owner Author

npr99 commented Feb 28, 2024

the above error seems to have negatively impacted the notebook. I tried to run the command 2+2 but the code block just ran and ran

@npr99
Copy link
Owner Author

npr99 commented Feb 28, 2024

rebuild the codespace... took about minutes. Automatically ran:
image

@npr99
Copy link
Owner Author

npr99 commented Feb 28, 2024

seems to be working - need to add
fpdf2==2.5.2
wget==3.2
to requirments. But since they are pip installed not sure if it will work. I was able to install both in the terminal.

@npr99
Copy link
Owner Author

npr99 commented Feb 28, 2024

also missing folium
in terminal conda install folium
install folium
Name Version Build Channel
folium 0.14.0 py312h06a4308_0

but getting error that it is not installed.
added to the requirements file and rebuilding

@npr99
Copy link
Owner Author

npr99 commented Feb 28, 2024

rebuild seems to have worked.
code is working found a bug in the directory_design file

needed to add
outputfolder = "OutputData"

Make directory to save output
if not os.path.exists(outputfolder):
os.mkdir(outputfolder)

@npr99
Copy link
Owner Author

npr99 commented Feb 28, 2024

issue with the family variable having missing values?
added mechatroner.rainbow-csv
need to add to codespace devcontainer
Issue replicates outside of codespace... need to address in another issue

@npr99
Copy link
Owner Author

npr99 commented Feb 28, 2024

codespace appears to be working.

got a
RemoteDisconnected: Remote end closed connection without response
it might be an issue with the census api

code ran the second time I ran it.

code space appears to work. All of the errors that I found were replicated outside of codespace

@npr99 npr99 closed this as completed Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant