Python Forum
Help with python code to search string in one file & replace with line in other file
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with python code to search string in one file & replace with line in other file
#16
Seems to lead me to different issue now regarding pathlib. Was getting
Quote:ImportError: No module named pathlib

Then I tried using pip to install pathlib and got:

Quote:pip install pathlib
Collecting pathlib
Downloading pathlib-1.0.1.tar.gz (49kB)
100% |████████████████████████████████| 51kB 1.2MB/s
Installing collected packages: pathlib
Running setup.py install for pathlib ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/tc/s83_bztx34783jsqlt75bb6r0000gn/T/pip-build-F8mpfz/pathlib/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/tc/s83_bztx34783jsqlt75bb6r0000gn/T/pip-BNm0zc-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib
copying pathlib.py -> build/lib
running install_lib
copying build/lib/pathlib.py -> /Library/Python/2.7/site-packages
error: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/pathlib.py'

----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/tc/s83_bztx34783jsqlt75bb6r0000gn/T/pip-build-F8mpfz/pathlib/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/tc/s83_bztx34783jsqlt75bb6r0000gn/T/pip-BNm0zc-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/tc/s83_bztx34783jsqlt75bb6r0000gn/T/pip-build-F8mpfz/pathlib/

I can't seem to win on this lol
Reply


Messages In This Thread
RE: Help with python code to search string in one file & replace with line in other file - by mforthman - Dec-18-2017, 07:51 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Cannot get cmd to print Python file Schauster 11 406 May-16-2024, 04:40 PM
Last Post: xMaxrayx
  Matching string from a file tester_V 5 531 Mar-05-2024, 05:46 AM
Last Post: Danishhafeez
  Python openyxl not updating Excel file MrBean12 1 405 Mar-03-2024, 12:16 AM
Last Post: MrBean12
  Python logging RotatingFileHandler writes to random file after the first log rotation rawatg 0 473 Feb-15-2024, 11:15 AM
Last Post: rawatg
  Unable to understand the meaning of the line of code. jahuja73 0 356 Jan-23-2024, 05:09 AM
Last Post: jahuja73
  connect sql by python using txt. file dawid294 2 508 Jan-12-2024, 08:54 PM
Last Post: deanhystad
  Writing a Linear Search algorithm - malformed string representation Drone4four 10 1,118 Jan-10-2024, 08:39 AM
Last Post: gulshan212
  file open "file not found error" shanoger 8 1,297 Dec-14-2023, 08:03 AM
Last Post: shanoger
  python Read each xlsx file and write it into csv with pipe delimiter mg24 4 1,629 Nov-09-2023, 10:56 AM
Last Post: mg24
  Search Excel File with a list of values huzzug 4 1,316 Nov-03-2023, 05:35 PM
Last Post: huzzug

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020