#Unable to access exercism exercises on replit

1 messages · Page 1 of 1 (latest)

atomic mango
#

I am trying to run the exercism projects on replit.

I've successfully installed the exercism CLI
I've configured the CLI using my personal API key
Downloading the individual project files also works

After downloading the files, I can't seem to find the files

The file path is written on the shell too but I have no idea how to access the files

I've tried using cd to change directory to the file path printed on the console but it's always saying not found

celest breach
#

I did not know you can use replit with exercism's tooling. Interestint.

What is the output of ls /home/runner/exercism/python ?

#

And please don't post screenshots but text, it is a lot easier to read.

hasty zealotBOT
atomic mango
#

ls home/runner/exercism/python outputs cannot 'access home/runner/exercism/python': No such file or directory

celest breach
#

Maybe it does not work and you don't have that kind of access rights for syour replit session. I don't know about those features, so it is pure speculation, sorry

atomic mango
#

@celest breach thanks

deep bison
#

~/Exercism and ~/exercism are different directories on Linux

atomic mango
#

@deep bison same result

wide pelican
#

Can you show the result for these two commands?

ls /home/runner/exercism
ls /home/runner/exercism/python
atomic mango
#

Even ls /home returns the above result

grizzled oasis
#

Some more diagnostic commands to try

pwd
whoami 
ls -lh /
echo $HOME

It might be that the current user doesn't have a home directory. In that case, you can check what directories you have permissions for and change exercism cli's directory to /tmp/exercism or something

#

I guess also try mount to see if the container has any volume mounts

atomic mango
#

Thanks @grizzled oasis I don't quite understand your suggestion but after trying them things seems to get better

ls /home/runner/exercism/python stopped bringing out this output cannot 'access home/runner/exercism/python': No such file or directory

Infact there are errors when changing to this directory but still yet I can't access the downloaded files, the file hierarchy on this repl remains unchanged

wide pelican
#

I've seen ls home/runner/exercism/python twice in your comments.
Beware: the paths some_directory and /some_directory can be different. The leading / means the root folder.
So make sure you typed in ls /home/runner/exercism/python (with leading /), not ls home/runner/exercism/python (without leading /).

atomic mango
#

@wide pelican I typed with the leading slash forgot to put it here

wide pelican
#

What baffles me is that the output of the CLI in your first comment clearly says:
"Downloaded to /home/runner/exercism/python/making-the-grade"
I don't know what's going on, I hope one of the other folks has an idea.

grizzled oasis
# atomic mango Thanks <@189103847648657408> I don't quite understand your suggestion but after ...

The comands that I suggested will produce some output, which can help with figuring out what's wrong; none of these commands will change anything.

pwd: prints the current working directory - I suggested this because it looks like you're working in a container, and often when you enter a container, it'll put you in a home directory that you have write access to

whoami - prints the name of the current user. I'm expecting it print runner based on where exercism tried to download the files to, but it might print something else

ls -lh / -- this lists the files/directories that are in the root directory, /. You said earlier that ls /home produced an error, which indicates a pretty restrictive environment, so it's good to know which of the other usual directories are accessible

echo $HOME is asking the shell that you're in where it thinks your current user's home directory is.

deep bison
#

The VM might offer a write-only filesystem for whatever reasons

#

Though I have no idea how you would have downloaded and run the exercism cli

grizzled oasis
#

Yeah. In that case, /tmp might still be writeable but may be ephemeral

#

there's an ~/Exercism directory in the screenshot, exercism configure -w ~/Exercism might work so that it would download the files to that directory

deep bison
#

If you can run the exercism cli, you were able to write and read that executable

#

Maybe the directory cannot be listed (execute permission) but the binary has +rwx set

atomic mango
#

Thanks @grizzled oasis. Am a complete noob at using CLI but I think I somehow grasp what you're explaining.

Please any suggestions on how I can change the exercism CLI to /tmp/exercism

grizzled oasis
#

try exercism configure -w /tmp/exercism

and then try to redownload the exercise

deep bison
#

Where is the exercism CLI executable located? How did you install it?
What do you get when you run type -p exercism ?

atomic mango
#

@grizzled oasis thanks.
I can't believe, it worked. Thanks a lot.

I'll go through the article u shared to get better acquainted too.
Thanks @deep bison

atomic mango
#

@grizzled oasis please I don't know why submitting brings up this error.

grizzled oasis
# atomic mango

It looks like you downloaded the exercise to /home/runner/Exercism/python/making-the-grade, but then you changed the exercism workspace directory to /tmp/exercism -- which is what i suggested when i didn't know where the exercise was being downloaded to, because it's the directory you're most likely to have write access to.

I think the best path forward here is to set exercism's directory to /home/runner/Exercism, exercism configure -w /home/runner/Exercism and then try exercism submit again.

After that, I think things will just work, now that you know how to use pwd and ls and cd to find where you are, what's in a directory, and navigate to different exercises that you download

atomic mango
#

@grizzled oasis thanks ama try that

grizzled oasis
#

good skill 🙂

atomic mango
#

Tried it out. It worked can't thank you enough 😭

grizzled oasis
#

Awesome, glad we could help

atomic mango
#

Please one more thing, most probably the last.

Trying to test from the console returns the error in the attached picture, any suggestions?

deep bison
#

Images are hard to read. Sharing text in a codeblock makes it much easier for us to read.

atomic mango
#

Okay I basically did this after changing to the directory where the test file is located

python3 -m pytest -o markers=task loops-test.py

It resulted in this being displayed:
/nix/store/1gc9wvzsy15pclrqfspii166pt2lmh5i-python3-3.10.13/bin/python3: No module named pytest

deep bison
#

That sounds like you need to install pytest

grizzled oasis
celest breach
grizzled oasis
#

I've never used replit and I only had nix installed for a few days before switching to Arch, but I think it's worth try.

celest breach
#

I just wanted to point out, that their use case is a lot more restricted than a normal machine

deep bison
#

If they managed to install exercism, they can get the pytest files on the machine somehow 😄

#

Though that doesn't mean it will be easy

atomic mango
#

Thanks @grizzled oasis and @celest breach and @deep bison

I installed pytest
And everything's been working like charm 😂

hasty zealotBOT
#

If everything is resolved, we ask that the author of the top/original post react with a :white_check_mark: (:white_check_mark:). This indicates to others that this issue has been resolved and locks the thread.
If all the tests pass and you want to further improve your solution, we encourage you to use the "Request a Code Review" feature on the website!

atomic mango
#

:white_check_mark:

#