1

This is my first question here. I'm new to Python, Django and Anaconda. I am trying to follow this tutorial but I keep running into hiccups. I found a similar answer to my question and I'm willing to admit that I could be misunderstanding something due to my lack of experience. I am using PyCharm and I'm installing the necessary packages (as needed for the tutorial) via the gui and I'm using the terminal inside PyCharm.

At this part of the tutorial where you're supposed to run the server of the project, I keep getting this error:

PackagesNotFoundError: The following packages are not available from current channels:    - manage

Whenever I go to install from conda forge or pip install in the terminal, I am met with the same errors.

Like I said, I found a similar post on here, but it is not the solution I need. I'm also not exactly sure what I'm doing wrong. I've installed and updated python and django, and everything requested in the tutorial.

PackagesNotFoundError: The following packages are not available from current channels:

Thank you in advance for anyone who helps me.

1 Answers1

0

Hey next time when you post a question add code in which you running and the whole error output in order to get the best help possible.

I am assuming running the Django application is the problem based on the information you've provided.

Try this open your terminal/command prompt and execute the following commands:

Unix

  1. creating directory for the project
mkdir <some_directory_name>
cd <some_directory_name>
  1. Creating python virtual env and activating it for your project.
python3 -m venv <some_env_name_of_choice>
source <some_env_name_of_choice>/bin/activate
  1. Installing Django and creating a project.
pip3 install django
django-admin startproject <project_name_of_choice>
  1. run Django app
cd <project_name_of_choice>
python manage.py runserver
  1. Go to your browser and type this to verify that the app is running
http://127.0.0.1:8000

Windows

  1. change into <some_directory_of_choice>

cd <some_directory_of_choice>

  1. create virtual environment

python3 -m venv ./venv

  1. activate the virtual env

source venv/bin/activate

  1. upgrade or install pip if need be

python -m pip install --upgrade pip

  1. run these 2 commands

python manage.py makemigrations

python manage.py migrate

  1. run a server

python manage.py runserver

  1. Go to your browser and type http://127.0.0.1:8000/

You might want to use python3 if running the command python gives an error. Don't forget to remove these <>

Check the official Django's site for examples on writing your first program with Django app. familiarise yourself with the basics of Django syntax etc.

Kevin Mukuna
  • 149
  • 1
  • 6
  • Okay, thank you so much. I'm sorry I didn't provide any code or the entire error output. & yes I am trying to run the django app. I'm about to try out your solution. – Rae Dickerson Oct 25 '21 at 02:13
  • Update: after reading your solution, I realize I've already done all of those steps. Here is error message. `\PycharmProjects\SampleWebsiteTutorial> python manage.py runserver \anaconda3\envs\SampleWebsiteTutorial\python.exe: can't open file 'C:\User \PycharmProjects\SampleWebsiteTutorial\manage.py': [Errno 2] No such file or dire ctory \PycharmProjects\SampleWebsiteTutorial> python3 manage.py runserver \AppData\Local\Microsoft\WindowsApps\python3.exe: can't open file 'manage. py': [Errno 2] No such file or directory` – Rae Dickerson Oct 25 '21 at 02:16
  • Also saying source is not recognized as a command. – Rae Dickerson Oct 25 '21 at 02:32
  • Are you running the program from the root of your project? did you follow the steps to create virtual env correctly? – Kevin Mukuna Oct 25 '21 at 02:40
  • The problem was that I didn't cd to root folder, you are right. I got confused because the tutorial asks to name two directories the same name, so I thought I was in root. But now its telling me `' does not appear to have any patterns in it. If you see valid patterns in the file then the issue is probably caused by a circular import.` when I try to make migrations. – Rae Dickerson Oct 25 '21 at 02:45
  • The error is in your `urls.py`, you either not importing your views correctly or not passing the pattern correctly. what in your `urls.py?` [check my GitHub](https://github.com/kevinmukuna/ripple.git) I have step details on how to run Django apps. – Kevin Mukuna Oct 25 '21 at 03:14
  • I think you're right. I'm currently at school so I won't be able to try again until later but I did figure out I was in the wrong dir & your tutorial was very helpful for that, thank you so much. – Rae Dickerson Oct 25 '21 at 19:37