I can't submit my CS50 code solution using terminal on mac - cs50

So I am trying to submit my CS50 (https://cs50.harvard.edu/x/2020/tracks/mobile/android/fiftygram/) in my terminal by using submit50 cs50/problems/2020/x/tracks/android/fiftygram. I have installed pip3 and CS50 but I keep getting an error zsh:
command not found: submit50
Please help! How do I solve this?

You also need to install submit50 itself. The instructions are here:
https://cs50.readthedocs.io/submit50/#installation
Edit: given the comment that OP has done this, try updating pip. It may be a version issue after switching to zsh. Alternatively, if you still have another shell use that.
https://unix.stackexchange.com/questions/557185/pip-error-after-changing-from-bash-to-zsh

Related

How do I upgrade a dumb shell to an interactive shell

I am looking for a way to upgrade my dumb reverse-shell to an interactive shell. I want to upgrade it with Method 3, which can be found here:
https://blog.ropnop.com/upgrading-simple-shells-to-fully-interactive-ttys/
The commands work properly until I try to foreground my shell. 'fg' is working like it is described in the guide but after my shell is foregrounded I am not anymore able to type in commands. It seems like my Shell is frozen. 'reset' would follow now which is necessary to proceed but since I can't type in anything, I cant proceed
Any Suggestions are very welcome
Thanks in advance
Okay, I found it out myself:
First of all I upgraded my dumb shell into a python shell which provides more feature than the original shell but is not completely interactive. Afterwards I used the method above to upgrade the python shell to a TTY shell.
I used:
which Python, Python2, Python3
to check my Python Version.
The command 'which' shows the complete Path and says not found if python is not installed.
Afterwards I have been running the following command (in my case was python3 installed):
python3 -c 'import pty; pty.spawn("/bin/bash")'
If you have another version installed than I had, you need to change python3 to python or python2.
I guess the problem was a bug with the dumb shell but this should fix it.
With the python shell you can follow the instructions I posted above :)
I think the problem occurs when you try to foreground the shell in a different line. If you are having a zsh shell you have to make sure to run the command as stty raw -echo;fg. For other shells you can run it in separate line.enter image description here
[enter image description here][2]

Problem with "import rarfile" in python on Ubuntu

Today I turned on my Ubuntu virtual machine and tried to do a project in Python 3.9.4,
but this one used rarfile module. Which is throwing errors.
I know rarfile uses unrar, and I installed both rarfile and unrar.
Tried to type unrar seperately and it works.
I almost spent whole day trying to figure this out.
My question is why does importing rarfile module not work, and how can I fix it.
I also read online it could have something to do with PATH, but I am pretty new to linux and don't know terminology of it and therefore don't know how to try to fix it.
Some information regarding that would probably help if not now, for the future problems regardless if it is connected to this problem or not.
Sorry if I formatted this post poorly, it's my 2nd post on here.
I would do pip install rarfile to make sure it is install
also you may want to do a pip list to make sure its intalled.
Also if python 2 is install then most likly you need to do pip3 install rarfile.

Pygame/Python/Terminal/Mac related

I'm a beginner, I have really hit a brick wall, and would greatly appreciate any advice someone more advanced can offer.
I have been having a number of extremely frustrating issues the past few days, which I have been round and round google trying to solve, tried all sorts of things to no avail.
Problem 1)
I can't import pygame in Idle with the error:
ModuleNotFoundError: No module named 'pygame' - even though it is definitely installed, as in terminal, if I ask pip3 to install pygame it says:
Requirement already satisfied: pygame in /usr/local/lib/python3.7/site-packages (1.9.4)
I think there may be a problem with several conflicting versions of python on my computer, as when i type sys.path in Idle (which by the way displays Python 3.7.2 ) the following are listed:
'/Users/myname/Documents', '/Library/Frameworks/Python.framework/Versions/3.7/lib/python37.zip', '/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7', '/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload', '/Users/myname/Library/Python/3.7/lib/python/site-packages', '/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages'
So am I right in thinking pygame is in the python3.7/sitepackages version, and this is why idle won't import it? I don't know I'm just trying to make sense of this. I have absoloutely no clue how to solve this,"re-set the path" or whatever. I don't even know how to find all of these versions of python as only one appears in my applications folder, the rest are elsewhere?
Problem 2)
Apparently there should be a python 2.7 system version installed on every mac system which is vital to the running of python regardless of the developing environment you use. Yet all of my versions of python seem to be in the library/downloaded versions. Does this mean my system version of python is gone? I have put the computer in recovery mode today and done a reinstall of the macOS mojave system today, so shouldn't any possible lost version of python 2.7 be back on the system now?
Problem 3)
When I go to terminal, frequently every command I type is 'not found'.
I have sometimes found a temporary solution is typing:
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
but the problems always return!
As I say I also did a system reinstall today but that has helped none!
Can anybody please help me with these queries? I am really at the end of my tether and quite lost, forgive my programming ignorance please. Many thanks.
Try it with the problem1
I'm not an expert neither, but I think you need to install both in terminal and python in order to use the program.
python -m pip install pygame
You should actually add the export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" to your .bash_profile (if you are using bash). Do this by opening your terminal, verifying that it says "bash" at the top. If it doesn't, you may have a .zprofile instead. Type ls -al and it will list all the invisible files. If you have .bash_profile listed, use that one. If you have .zprofile, use that.
Type nano .bash_profile to open and edit the profile and add the command to the end of it. This will permanently add the path to your profile after you restart the terminal.
Use ^X to exit nano and type Y to save your changes. Then you can check that it works when you try to run the program from IDLE.

Python | Python.exe- Entry point not found

I installed (extracted) Kivy (Kivy-1.9.0-py3.4-win32-x86.exe) on my PC (Win7 32bit). Now whenever trying to run a file using kivy-3.4.bat getting an error message within a window...
python.exe- Entry point not found
The procedure entry point inflateReset2 could not be located in the dynamic link library zlib1.dll.
Once click on the "Ok" button I see
[Critical ] [app] unable to get a window, abort
on CMD.
I think this is a problem related to my system and Python more than Kivy. Can anyone tell me what is the problem and how to solve it?
This is amazing!! Even in StackOverFlow no one could give me any solution!!
Yes, I know this post is a bit old, but maybe someone else searches this.
I got the same error. And really, I just tried to start the python script via MS Powershell instead of CMD. I just wanted to use the PS one time.
And it worked, at least for me.
So, if you encounter this error, try to use the Powershell :)
This happened to me because an old zlib1.dll was being loaded from somewhere in my PATH. I copied a new version to system32 and it solved the problem.
It might be worth looking at this page:
http://kivy.org/docs/installation/installation-windows.html#start-a-kivy-application
I have the same issue. Finally I solve it with running command with administrator privilege (when the command === python -m pip install kivy.deps.gstreamer --extra-index-url https://kivy.org/downloads/packages/simple/).

Error in using 'theano-nose' command

After installing Theano from Enthought Canopy on Windows, following the steps here: http://deeplearning.net/software/theano/install.html#id9 , I tried to execute the command theano-nose from Canopy terminal. I got an error message saying "unable to find theano-nose". Can someone tell me what might be going wrong?
theano-nose is from the command line. But your shell need to be able to find it.
It is highly possible it didn't got installed correctly on Windows or that you need to reboot or log out/log in. I do not remember Windows particularities on that level.
But a simple work around is to start python and run this:
import theano
theano.test()
This is equivalent for what you want to do.

Resources