Python Forum
PermissionError while running function
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PermissionError while running function
#12
Hey! I changed the code, it still gives the error with this:

Checking that n_files divided by n_pts is an integer...
Done!
Summing up mcas in mca_file...
DEBUG: is file?  False \\...\home\s\myacc\Documents\XAS\mca_CeNO3_I1
Traceback (most recent call last):

  File "\\...\home\s\myacc\Documents\Python Scripts\CeNO3.py", line 45, in <module>
    I1_data = fn.sum_import_data_2(n_pts, n_chnl, I1_mca_file)

  File "\\...\home\s\myacc\Documents\Python Scripts\Functions.py", line 134, in sum_import_data_2
    mcadata[:, energy_point] += np.loadtxt(filename)

  File "C:\LocalData\myacc\Anaconda\lib\site-packages\numpy\lib\npyio.py", line 981, in loadtxt
    fh = np.lib._datasource.open(fname, 'rt', encoding=encoding)

  File "C:\LocalData\myacc\Anaconda\lib\site-packages\numpy\lib\_datasource.py", line 269, in open
    return ds.open(path, mode, encoding=encoding, newline=newline)

  File "C:\LocalData\myacc\Anaconda\lib\site-packages\numpy\lib\_datasource.py", line 621, in open
    encoding=encoding, newline=newline)

PermissionError: [Errno 13] Permission denied: '\\\\...\\home\\s\\myacc\\Documents\\XAS\\mca_CeNO3_I1'
What's strange is that previously I ask the function to calculate the files in the mca_file folder, and that works just fine and the number of files is correct, but somehow for that part of the function the repository can't be found.
Reply


Messages In This Thread
RE: PermissionError while running function - by Laplace12 - Aug-01-2020, 02:13 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  the order of running code in a decorator function akbarza 2 571 Nov-10-2023, 08:09 AM
Last Post: akbarza
  Class function is not running at all even though it is clearly run in the code SheeppOSU 2 2,159 Sep-26-2020, 10:54 PM
Last Post: SheeppOSU
  Fixing "PermissionError: [Errno 13] Permission denied" puredata 17 72,994 Mar-09-2020, 03:20 PM
Last Post: syssy
  Running function from parent module which has a loop in it. ta2909i 1 2,723 Nov-18-2019, 07:04 PM
Last Post: Gribouillis
  PermissionError: [Errno 13] Permission denied: error leviathan54 2 46,750 Apr-20-2019, 12:51 AM
Last Post: leviathan54
  [python] PermissionError: [Errno 13] Permission denied akamouch 1 42,496 Feb-07-2019, 03:28 PM
Last Post: ichabod801
  PermissionError Quavin 1 2,790 Dec-02-2017, 10:34 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

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