{"id":20821332,"url":"https://github.com/prakharjadaun/python-necessary-commands","last_synced_at":"2026-04-29T14:39:30.369Z","repository":{"id":234531642,"uuid":"788952056","full_name":"prakharjadaun/Python-Necessary-Commands","owner":"prakharjadaun","description":"Repo contains several commands which can be helpful in ML projects.","archived":false,"fork":false,"pushed_at":"2024-04-21T06:00:08.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-26T20:44:37.673Z","etag":null,"topics":["conda","huggingface","keras","langchain","pip"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prakharjadaun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-19T12:12:00.000Z","updated_at":"2024-04-21T06:00:11.000Z","dependencies_parsed_at":"2024-11-17T22:12:07.259Z","dependency_job_id":"d563ccee-9e27-4035-9eff-38a5019e5444","html_url":"https://github.com/prakharjadaun/Python-Necessary-Commands","commit_stats":null,"previous_names":["prakharjadaun/python-necessary-commands"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/prakharjadaun/Python-Necessary-Commands","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prakharjadaun%2FPython-Necessary-Commands","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prakharjadaun%2FPython-Necessary-Commands/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prakharjadaun%2FPython-Necessary-Commands/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prakharjadaun%2FPython-Necessary-Commands/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prakharjadaun","download_url":"https://codeload.github.com/prakharjadaun/Python-Necessary-Commands/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prakharjadaun%2FPython-Necessary-Commands/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32429741,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T13:34:34.882Z","status":"ssl_error","status_checked_at":"2026-04-29T13:34:29.830Z","response_time":110,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["conda","huggingface","keras","langchain","pip"],"created_at":"2024-11-17T22:11:58.189Z","updated_at":"2026-04-29T14:39:30.354Z","avatar_url":"https://github.com/prakharjadaun.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# **Python Necessary Commands**\n\nThis repository contains several commands which can be helpful in ML projects and you should know.\n\n## Pip\n\n- To upgrade pip\n```\npython -m pip install --upgrade pip\n```\n- To check the version of pip\n```\npip --version\n```\n- To downgrade the pip version\n```\npython -m pip install pip==version_name\n```\n- To get all the packages installed, along with their specific version and location.\n```\npip list\n```\n- To resolve conflicts when installing requirements.txt using pip\n```\n!pip install -r requirements.txt --use-deprecated=legacy-resolver\n```\n## Conda\n\n- To create a virtual environment using conda (you can use any version of python)\n```\nconda create -p venv python==3.10.0 -y\n```\n- To activate a virtual environment you created locally (venv is the name of virtual env)\n```\nconda activate venv/\n```\n- If pip not working in virtual env ([source](https://stackoverflow.com/questions/37220055/pip-fatal-error-in-launcher-unable-to-create-process-using))\n```\npython -m pip install --upgrade --force-reinstall pip\n```\n## Keras\n\n- To save keras model\n```\n# after training\nmodel.save(\"model_name.h5\")\n```\n- To load the keras model\n```\nmodel = keras.models.load_model(\"model_name.h5\")\n```\n- To save keras model's weight\n```\nmodel.save_weights(\"model_weights.h5\")\n```\n- To load the weights\n```\nmodel.load_weights(\"model_weights.h5)\n```\n- To save the architecture as json\n```\njson_string = model.to_json()\nwith open(\"filename\",\"w\") as f:\n  f.write(json_string)\n```\n- To load the json file:\n```\nwith open(\"filename\",\"r\") as f:\n  loaded_json_string = f.read();\n```\n## HuggingFace\n\n- Remove downloaded Tensorflow and Pytorch(HuggingFace) Models ([source](https://stackoverflow.com/questions/65037368/remove-downloaded-tensorflow-and-pytorchhugging-face-models))\n```\nhuggingface-cli delete-cache\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprakharjadaun%2Fpython-necessary-commands","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprakharjadaun%2Fpython-necessary-commands","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprakharjadaun%2Fpython-necessary-commands/lists"}