#๐Ÿ”’ pip not found

6 messages ยท Page 1 of 1 (latest)

quick delta
#

I am trying to make a list of all the uk universities in order. Trying to import panda but it is not working.

pip : The term 'pip' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1

  • pip install pandas geopy
  •   + CategoryInfo          : ObjectNotFound: (pip:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException
    
    

I get this error.

thorny starBOT
#

@quick delta

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

quick delta
#

import pandas as pd
from geopy.distance import geodesic

# Load the CSV file
file_path = r'C:\Python\UK Universities\uk_universities_locations.csv'
universities_df = pd.read_csv(file_path)

# Coordinates for WS10 Wednesbury
ws10_coords = (52.5528, -2.0235)

# Function to calculate distance from WS10 Wednesbury
def calculate_distance(row):
    university_coords = (row['lat'], row['lon'])
    return geodesic(ws10_coords, university_coords).kilometers

# Calculate distances and add as a new column
universities_df['distance_to_ws10'] = universities_df.apply(calculate_distance, axis=1)

# Sort universities by distance
sorted_universities_df = universities_df.sort_values(by='distance_to_ws10')

# Save to a new CSV file
output_path = r'C:\Python\UK Universities\uk_universities_sorted_by_proximity_to_ws10.csv'
sorted_universities_df.to_csv(output_path, index=False)

# Get the closest university
closest_university = sorted_universities_df.iloc[0]

# Display the closest university
print(closest_university)
feral condor
#

You need to have Python/pip on your PATH to be able to run pip like that. Do you have Python installed?

thorny starBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.